On Mon, Apr 13, 2009 at 5:34 PM, C M <cmpyt...@gmail.com> wrote:
> Hi, I've asked this before but still am stuck. I want to use
> mpl's automatic tick locating and date formatting for a zoomable
> date plot, OTHER THAN the hour formatting. The default hour formatting
> (when zoomed in on 1 day) is like "05:00:00 UTC", but I'd like to be
> of the form something more readable for users, like: "5:00pm 12/03".
>
> If I just use my own custom date formatter, then ALL the zoom levels
> will have this format, but I'd only like it for when the plot is zoomed
> down to the level of one day. (So it is a rule of "if zoomed to one day,
> use my custom dateformatter, otherwise, use the automatic one").
>
> Why I'd like this: for looking across weeks or months worth of data,
> hours are irrelevant, but for looking at days, hours are relevant, but
> users will not think in terms of UTC and they will want to see on the
> x axis which day they are looking at.
>
> Does anyone know how this can be done in mpl? Thank you,
I don't think matplotlib supports anything like this out of the box.
However, you should be able to do this by subclassing the Formatter class in
matplotlib/ticker.py. I believe Chaco has support for ticking like this for
dates, so you could look to it for inspiration on how to go about
implementing the concept.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users