New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to major/minor locator on a DateTime index leads to messed up axis #26293
Comments
Pandas tick formatting is quite a bit more complex that that. I would recommend just using matplotlib entirely, rather than trying to customize a pandas-produced axes. |
If you can identify a specific issue, then we can leave this open. Otherwise I worry that it's just going to sit around in an unclear state. |
Hi Tom, in the end I used matplotlib directly. I think it would help to at least a sentence somewhere that states your recommendation. That would have at least helped me. Maybe a comment in a documentation would be good or maybe this issue is enough. |
A clarification in
http://pandas-docs.github.io/pandas-docs-travis/user_guide/visualization.html#plotting-directly-with-matplotlib
would be welcome if you can think of a good phrasing.
…On Fri, May 17, 2019 at 2:53 AM metaswirl ***@***.***> wrote:
Hi Tom, in the end I used matplotlib directly. I think it would help to at
least a sentence somewhere that states your recommendation. That would have
at least helped me. Maybe a comment in a documentation would be good or
maybe this issue is enough.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#26293?email_source=notifications&email_token=AAKAOIQZ4QJI4T2YGUXAAXLPVZQBFA5CNFSM4HLARK22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVUBARY#issuecomment-493359175>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIWIONFLP2IWZGRIQLTPVZQBFANCNFSM4HLARK2Q>
.
|
Well, the wording could be either "Don't use pandas for changing ticks in a timeseries plot." to "While ticks in a timeseries plot can be changed in pandas, it is still an experimental feature. Use matplotlib when you experience troubles." Or if you have more insight, in when the problem occurs, then it would help to mention that. |
Something like that sounds reasonable, though I might not use
"experimental". More so not easily customizable after the fact,
compared to if you used matplotlib directly. And this is a general
recommendation with DataFrame.plot, not timeseries-specific.
Are you interested in making a PR adding that to the documentation?
…On Wed, May 22, 2019 at 6:43 AM metaswirl ***@***.***> wrote:
Well, the wording could be either "Don't use pandas for changing ticks in
a timeseries plot." to "While ticks in a timeseries plot can be changed in
pandas, it is still an experimental feature. Use matplotlib when you
experience troubles." Or if you have more insight, in when the problem
occurs, then it would help to mention that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#26293?email_source=notifications&email_token=AAKAOIU2ZJSUYWGG6UAUGJLPWUWWJA5CNFSM4HLARK22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV6Y25Q#issuecomment-494767478>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIU4G4Z3ADUH7GHDXIDPWUWWJANCNFSM4HLARK2Q>
.
|
Sorry for the delay, above you find a pull request to add a line to the docs. |
Code Sample
Problem description
I was plotting a DataFrame with a DateTime index and tried to change the major and minor ticks afterwards. I expected an x-axis with ticks every 6-hours. Instead the x-axis became filled with ticks at what I assume to be hourly intervals.
This behavior does not occur, when either matplotlib is used to plot the columns
ax.plot(...)
or when the DateTime index contains gaps. Both cases are shown in the comments above.The issue appeared both with pandas versions 0.24.1 and 0.24.2.
Expected Output
Output
The text was updated successfully, but these errors were encountered: