-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: 7023 allow style when using error bars #57967
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
Conversation
pandas/plotting/_matplotlib/core.py
Outdated
@@ -974,6 +974,9 @@ def _plot( | |||
kwds["xerr"] = np.array(kwds.get("xerr")) | |||
if "yerr" in kwds: | |||
kwds["yerr"] = np.array(kwds.get("yerr")) | |||
# GH 7023 allow setting plot style when using errorbars |
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.
# GH 7023 allow setting plot style when using errorbars | |
# GH 7023 |
Thanks for the PR! Sorry that this hasn't been reviewed yet. In the meantime can you fix the merge conflict? |
doc/source/whatsnew/v3.0.0.rst
Outdated
@@ -372,7 +372,7 @@ Period | |||
|
|||
Plotting | |||
^^^^^^^^ | |||
- | |||
- Bug in :meth:`MPLPlot._plot` ignoring parameter ``style`` when using error bar parameters ``yerr`` or ``xerr`` (:issue:`7023`) |
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.
Same comment as in original PR, "Can you describe this in a user-facing way"?
I.E. the method that the user uses is not MPLPlot._plot
but rather DataFrame.plot
or Series.plot
No problem at all. I will take a look at your comments and get it up to date as soon as I get a minute (probably tomorrow). |
Apparently 1 check fails in relation to
Is there something you need me to do, or a way I can re-run the checks? |
This is what I'm seeing:
I don't know of a better way, but, you can merge with main if you want to re-run the checks |
Update: this failure seems to be happening on all PRs, you have nothing to worry about! |
Thanks for letting me know. I thought it was a bit strange. Let me know if you need me to force the checks to re-run (and when). |
I understand you requested my review but I don't know much about the plotting code to help review this, maybe @mroeschke can help |
Unfortunately we don't have anyone on the core team who really understands the plotting code anymore. I can try looking later to give a high level review |
No problem. The code change is very small, and was actually originally provided in PR #40816 . I have just added the tests that were missing. |
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
I will update this soon to keep it available. |
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen. |
@mroeschke I have merged the main branch in and pushed it to my fork of pandas. I suspect you will need to reopen before it gets pulled across here? |
doc/source/whatsnew/v3.0.0.rst
file if fixing a bug or adding a new feature.If the 'style' parameter is passed to the DataFrame's 'plot' method at the same time as error bar parameters 'yerr' or 'xerr' (or both), then the 'style' parameter is not applied to the plot. For example, something like this:
ax = df.plot(xerr=err_x, yerr=err_y, style='or:')
will result in the marker style, color and line style being ignored.
This PR passes the style parameter to the plot.
The comments in the bug report mention a work around not working with 'subplots'. As such, I have created scenario in the tests that confirm this fix will also work for subplots.
Note: This fix is identical to that previously provided by @GLeurquin (PR #40816), but it went stale and was closed. I have basically added the missing tests that were requested, and never provided.