Hi Chris, On Fri, May 15, 2009 at 21:29, Christopher Barker <chris.bar...@noaa.gov> wrote: > Hey folks, > > IN old mailing list messages, I see reference to: > > mpl.ticker.AutoDateLocator > mpl.ticker.AutoDateFormatter > > > Where might I find these now? They don't seem to be in matplotlib.ticker > or matplotlib.date. do they have a new name? Is there a new way to get > automatic date tic location and formating?
In [14]: from matplotlib import dates In [15]: dates.Au dates.AutoDateFormatter dates.AutoDateLocator > note: I'm trying to do this for the x axis of a quiver plot, which > doesn't seem to support passing in dates directly. simple snippet (with some additional formatting and stuff you might need): In [13]: dateFmt = mpl.dates.DateFormatter('%Y-%m-%d') In [14]: ax2.xaxis.set_major_formatter(dateFmt) In [15]: daysLoc = mpl.dates.DayLocator() In [16]: hoursLoc = mpl.dates.HourLocator(interval=6) In [17]: ax2.xaxis.set_major_locator(daysLoc) In [18]: ax2.xaxis.set_minor_locator(hoursLoc) In [19]: fig.autofmt_xdate(bottom=0.18) # adjust for correct date labels display In [20]: fig.subplots_adjust(left=0.18) HTH Cheers, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users