Skip to content
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

ENH: plot.scatter passes errorbar specific keyword arguments to ax.er… #46954

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

selasley
Copy link
Contributor

@selasley selasley commented May 6, 2022

…rorbar() (#46952)

  • closes #46952 (Replace xxxx with the Github issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@@ -687,6 +687,7 @@ Plotting
- Bug in :meth:`DataFrame.boxplot` that prevented specifying ``vert=False`` (:issue:`36918`)
- Bug in :meth:`DataFrame.plot.scatter` that prevented specifying ``norm`` (:issue:`45809`)
- The function :meth:`DataFrame.plot.scatter` now accepts ``color`` as an alias for ``c`` and ``size`` as an alias for ``s`` for consistency to other plotting functions (:issue:`44670`)
- The function :meth:`DataFrame.plot.scatter` now passes errorbar keywords to ax.errorbar (:issue:`46952`)
Copy link
Member

@mzeitlin11 mzeitlin11 May 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this more user-facing than mentioning ax.errorbar - perhaps that it now accepts matplotlib errorbar keywords to allow customizating the axis errorbar

@@ -1089,6 +1089,32 @@ def _make_plot(self):
plot_colorbar = self.colormap or c_is_column
cb = self.kwds.pop("colorbar", is_numeric_dtype(c_values) and plot_colorbar)

# move matplotlib.errorbar specific keywords that are not accepted by
# ax.scatter to an err_kwds dict for use in the call to ax.errorbar
ebarkeys = {
Copy link
Member

@mroeschke mroeschke May 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think hardcoding this is a robust approach as it may be brittle to API changes for matplotlb.errorbar.

Is there a way for this to be validate directly by matplotlib.errorbar

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

Successfully merging this pull request may close these issues.

3 participants