SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Thanos P. <pt...@gm...> - 2007年06月29日 14:40:59
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.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /