You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although the labelling is definitely nicer in the regular timeseries case, the cursor x axis value is not shown (bottom right corner with the tk pylab backend) http://imgur.com/WCe6P,o8jge#0:
The irregular timeseries with the standard matlplotlib plot_date labelling does show a value for the cursor x axis value: http://imgur.com/WCe6P,o8jge#1
I tried with the qt backend and I get the same results so it appears to be backend independent.
Not a huge deal but I find the cursor x axis value quite useful from time to time when interactively inspecting a plot (zooming, panning, etc...).
The text was updated successfully, but these errors were encountered:
I see this has been tagged as Community, I'd be more than happy to take a look at this if I could get a few pointers to get started.
I actually started looking in matplotlib.axes.AxesSubplot.format_coord (let me know if this was the wrong place to start from) and ended up in pandas.tseries.converter.TimeSeries_DateFormatter.__call__ (ax.fmt_xdata is None in my case but that might be set to a function if we don't want to use the formatter in this case).
In my case the formatter formatdict is an empty dict so __call__ will always return an empty string. I am not sure I understand the reason for the pop (getting the string for a x coordinate may work only once) or the structure of the formatdict (do you really want one format string per timestamp), although I am guessing this is used in the scikits.timeseries style tick labelling.
Final question what is x supposed to be in this case, is it just an the underlying int64 value of the pandas.Timestamp? What's the best way to get it from a pandas.Timestamp object?
A simple, possibly crude solution would be to use something like the following at the end of tsplot(series, plotf, **kwargs) in pandas/tseries/plotting.py
ax.format_coord = lambda t, y : "t = {:%Y-%m-%d %H-%M} y = {}".format(\
datetime.fromtimestamp(t, series.index.to_timestamp().tz)), y)
Hi,
you should be able to paste the following snippet in a ipython --pylab session
Although the labelling is definitely nicer in the regular timeseries case, the cursor x axis value is not shown (bottom right corner with the tk pylab backend)
http://imgur.com/WCe6P,o8jge#0:
The irregular timeseries with the standard matlplotlib plot_date labelling does show a value for the cursor x axis value:
http://imgur.com/WCe6P,o8jge#1
I tried with the qt backend and I get the same results so it appears to be backend independent.
Not a huge deal but I find the cursor x axis value quite useful from time to time when interactively inspecting a plot (zooming, panning, etc...).
The text was updated successfully, but these errors were encountered: