milliseconds in matplotlib.dates?
Greetings, everyone. I have some time tagged data spanning about three minutes with 4 ms resolution. If I plot these with plot_data and focus in on some event at high resolution I lose the tick marks. It seems that the minimum tick spacing is 1 sec. That appears consistent with strftime which does not provide for fractional seconds. I thought I saw this issue go by not long ago but I don't recall the solution, if any. I'm using python 2.5.2 and matplotlib 1.1.0. Thanks and regards, Tom
On Wed, Mar 24, 2010 at 1:25 PM, Tom Kuiper <kuiper@jpl.nasa.gov> wrote:
Greetings, everyone.
I have some time tagged data spanning about three minutes with 4 ms resolution. If I plot these with plot_data and focus in on some event at high resolution I lose the tick marks. It seems that the minimum tick spacing is 1 sec. That appears consistent with strftime which does not provide for fractional seconds.
I thought I saw this issue go by not long ago but I don't recall the solution, if any.
I'm using python 2.5.2 and matplotlib 1.1.0.
Thanks and regards,
Tom
Hi, As far as I know SecondLocator() is the smallest it gets for time-date plotting in matplotlib. Probably a new class needs to be written for MilliSecondLocator() in dates.py Alternatively, you might use just floating-point version of your time values and with a little adjustment (Ryan mentioned this in the recently, and will forward there for other suggestions) millisecond resolutions should be visible when zoomed in furthest. Something like: sci_fmt = plt.FormatStrFormatter("%.2f") plt.gca().xaxis.set_major_formatter(sci_fmt) By the way, where did you get mpl v1.1.0? Mine says: In[19]: matplotlib.__version__ Out[19]: '1.0.svn' -- Gökhan
participants (2)
-
Gökhan Sever
-
Tom Kuiper