AutoDateLocator

Committed into svn 2142.

Thanks for the patch James, the auto date functionality is very
nice. Just a minor comment. In the load_converter.py example, the
default ticks overlap each other with the default window size. I
think we are using a format string that is too long for this date
range.

JDH

John,

I had noticed that as well, and when I used it I was rotating the labels by "-90" degrees to
see them more clearly. But doing so uncovers a bug/feature when using any AutoTickLocator
mechanism.

When you want to rotate the labels, you do so by doing something like the following:

ax = subplot(111)
plot_date(dates, values, '-')
labels.ax.get_xticklabels()
setp(labels, rotation=-90)

the problem being that this will only set the property of the first 'n' labels, where 'n' is
the number of tickmarks present when you initially set the property. So if the number of
tick marks increases when zooming in (or out), then the remaining labels above 'n' will not
have the property set. You can see this by running the example script "simple_plot.py" and
rotating the labels (as above) and then zooming in and out until you have more than the
initial number of ticks.

Perhaps a solution would be to set "default" properties for the axis in question, which
would then always set those properties for the tickmarks, unless specifically overridden by
the user as in the above case.

--James Evans

···

-----Original Message-----
From: John Hunter [mailto:jdhunter@…5…]
Sent: Monday, March 13, 2006 7:54 AM
To: Andrew Straw
Cc: James Evans; matplotlib-devel@lists.sourceforge.net
Subject: Re: [matplotlib-devel] AutoDateLocator

    > Committed into svn 2142.

Thanks for the patch James, the auto date functionality is very
nice. Just a minor comment. In the load_converter.py example, the
default ticks overlap each other with the default window size. I
think we are using a format string that is too long for this date
range.

JDH