Skip to content

Conversation

@rosnfeld
Copy link
Contributor

Fixes #5453

I am not sure how to test a mouse-over, and the original commit 922c610 introducing this functionality did not have tests either, which is sadly probably how this got broken. @willfurnass do you happen to have any ideas for how to test this functionality, maybe from when you first looked at this?

The new code doesn't display timezone information like the old code once did (before it was broken) as Periods don't seem to have timezone info, and all tseries/plotting.py plots are Period-based. One could perhaps do some minor acrobatics to convert the tz-naive start time of the Period into a tz-aware Timestamp, I can research that if people feel strongly about it.

@rosnfeld
Copy link
Contributor Author

Hmm, actually I kind of like leaving the display as a Period - works nicely for Weeks, Quarters, etc.

@jorisvandenbossche
Copy link
Member

Maybe you could try to test it by making a plot, and then feeding manually data to ax.format_coord and test if this is formatted well. Something like:

s = pd.Series([1,2,3], index=pd.date_range('2014-01-01', periods=3, freq='H')) ax = s.plot() string = ax.format_coord(some_data) assertEqual(string, expected) 

and that for different frequencies. Just an idea, don't know if this will really work.

@rosnfeld
Copy link
Contributor Author

Yup that works - I've added a test along those lines that would have caught the original issue.

@jreback jreback added this to the 0.14.0 milestone Apr 30, 2014
@jreback
Copy link
Contributor

jreback commented Apr 30, 2014

@jorisvandenbossche @TomAugspurger ok with this...

@rosnfeld ping when green

@rosnfeld
Copy link
Contributor Author

@jreback ping

@jreback
Copy link
Contributor

jreback commented May 1, 2014

@TomAugspurger if this is ok
go ahead and merge

TomAugspurger pushed a commit that referenced this pull request May 1, 2014
BUG: fixing tseries plot cursor display, resolves #5453
@TomAugspurger TomAugspurger merged commit 07f6d46 into pandas-dev:master May 1, 2014
@TomAugspurger
Copy link
Contributor

Thanks @rosnfeld

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Datetime Datetime data dtype Visualization plotting

4 participants