-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
Update visualization.rst #27092
Update visualization.rst #27092
Conversation
@@ -1608,6 +1608,9 @@ available in matplotlib. Although this formatting does not provide the same | |||
level of refinement you would get when plotting via pandas, it can be faster | |||
when plotting a large number of points. | |||
|
|||
**Note**: The customization of datetime ticks in a timeseries plot can lead to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Small nits:
- Could you use the
.. note::
directive here Use matplotlib directly for full customization of axis ticks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, I think it'd be good to expand a bit when these problems can happen, and what kind of problems users can face. The note seems to generic to me to add much value to the readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mroeschke Thanks, I changed the formatting. Let me know, if this works for you.
@datapythonista The issue occurred to me when changing the minor/major locator/formatter. The result was that the indices became obfuscated (see picture in #26293 ). TomAugspurger mentioned that this is caused by the complex tick structure in pandas. So, I would propose to either leave it as a general recommendation/note or bring someone in that has more knowledge of the structures than me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think anyone really understands the tick formatting code in pandas right now.
To make this a bit more useful, perhaps something like
Pandas registers custom tick formatters for time series data. These may conflict with custom locators or formatters you apply after plotting. For complete control over the plot, use matplotlib directly, rather than :class:`DataFrame.plot`.
Looks like you have a linting error: https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=13617
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the text to Tom Augspurger's version. The syntax error is fixed.
@@ -1608,6 +1608,13 @@ available in matplotlib. Although this formatting does not provide the same | |||
level of refinement you would get when plotting via pandas, it can be faster | |||
when plotting a large number of points. | |||
|
|||
.. note:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very duplicative of the paragraph above. I would maybe slightly edit that paragraph rather than adding new.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paragraph above is about performance, this note is about correctness. I think it is a good idea to highlight the second, because it can surprise users (it surprised me). So I disagree with you, but then if this is important to you, you could propose an alternative.
@TomAugspurger any thoughts on this? |
What does this add to the paragraph starting with "In some situations it
may still be preferable or necessary to prepare plots"?
They both seem to be about using Matplotlib directly rather than
DataFrame.plot.
…On Mon, Aug 26, 2019 at 1:08 PM William Ayd ***@***.***> wrote:
@TomAugspurger <https://github.com/TomAugspurger> any thoughts on this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27092?email_source=notifications&email_token=AAKAOIT6I2K3YQWJ3ZDZRSTQGQL2RA5CNFSM4H4E7AZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5FFR7I#issuecomment-524966141>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIQEGU77MGLETDDPC2LQGQL2RANCNFSM4H4E7AZA>
.
|
I agree with Jeff and Tom, the note in this PR is just repeating what it's already in the docs. Closing this, and since the issue is still open, if someone has a better idea on how to help the users understand the problem with ticks, can open a new PR. |
closes #26293
Note added to the docs, warning users to be careful when adapting datetime indices generated by pandas.