On Tue, Nov 30, 2010 at 7:00 PM, C M <cmpyt...@gmail.com> wrote: > Thanks, Ryan. I've done that now. I use the OOP approach to matplotlib and > embed it in wxPython, so my example uses that. I did not know how to apply > an AutoDateFormatter to an axis if using pylab and figured the basics of > what I am trying to do are apparent from this sample. > > The sample is attached. The point of it is that, despite it apparently > using my AutoDateFormatter, all the dates at all levels of zoom are %Y (e.g. > "2010"). This is because in the AutoDateFormatter subclass, the line: > > scale = float( self._locator._get_unit() ) > > is *always* returning 365.0. > > I am not bothering for now to include the business about how point-picking > remedies my problem, because the AutoDateFormatter shouldn't need > that--obviously, the way I am doing it is wrong, and I'd like to know what > it is.
I'm guessing your problem was that only the year was being shown, regardless? It would seem the problem stems from the fact that while you give your formatter the AutoDateLocator, you never tell the axis to use this. I got what I considered the correct behavior by adding the following line at linen 84 in the script: self.subplot.xaxis.set_major_locator(adl) Does adding that get you what you want? Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users