Hello list,

I am plotting some time series data, and the ranges vary dramatically. I
cannot find a way to configure the major and minor ticking (hours and days
respectively) to scale automatically: if the range is too large, put a tick
every 8 hours instead of one, or even place a minor day tick every week and
dont do any hour ticking.

   ax.plot_date(date2num(times),points,'-',color="blue")

   days = DayLocator()
   daysFmt = DateFormatter('%d/%m')
   ax.xaxis.set_minor_locator(days)
   ax.xaxis.set_minor_formatter(daysFmt)
   hours = HourLocator()
   hours.autoscale()
   hoursFmt = DateFormatter('%H')
   ax.xaxis.set_major_locator(hours)
   ax.xaxis.set_major_formatter(hoursFmt)

   for tick in ax.xaxis.get_minor_ticks():
       tick.set_pad(13)

The pad trick is a cool answer I got in a previous post.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to