I raised this a week or so ago on mpl-users, and after some more
digging I thought I'd bring it over to mpl-dev.
With the following snippet, I expect a vertical Line2D from y=(0, 2)
and a Collection of squares at y=(4, 5, 6) at the specified time.
The actual result is a vertical line and no squares, even though the y
axis limits adjust to (0,7) as if something is being plotted with the
call to scatter.
from pylab import *
from datetime import datetime
ln, = ax.plot((d,d,d),range(3)) # vertical line
sc = ax.scatter((d,d,d),(4,5,6),marker='s') # no symbols plotted
However, with ax.xaxis_date() just before show(), I see the Collection.
What is the cause of this inconsistency? I was surprised by it, since
I naively assumed that once the axis property was set, future
additions to the axes would plot with the date axis in mind, as Line2D
seems to. I poked around a bit with the _transform, _transforms, and
_transOffset properties of the collections, but didn't get anywhere.
I'll be using date axes heavily in an interactive MPL project, where
it would be nice to set the date axes once and forget about it. I'm
willing to work on a fix if the problem is more than a lack
understanding on my end.