Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Cursor x axis value is not shown when using regular timeseries #1670
you should be able to paste the following snippet in a ipython --pylab session
import pandas index = pandas.date_range(start='2001-1-1', end='2001-1-10', freq='D') ts = pandas.TimeSeries(index=index, data=index.day) figure() ts.plot() figure() ts[:3].append(ts[6:]).plot()
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)
The irregular timeseries with the standard matlplotlib plot_date labelling does show a value for the cursor x axis value:
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...).
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
def __call__(self, x, pos=0): if self.formatdict is None: return '' else: fmt = self.formatdict.pop(x, '') return Period(ordinal=int(x), freq=self.freq).strftime(fmt)
In my case the formatter formatdict is an empty dict so
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