Skip to content

Backport PR #27921 on branch v3.8.x (Avoid modifying user input to Axes.bar) #27925

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2394,7 +2394,8 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
# checking and processing will be left to the errorbar method.
xerr = kwargs.pop('xerr', None)
yerr = kwargs.pop('yerr', None)
error_kw = kwargs.pop('error_kw', {})
error_kw = kwargs.pop('error_kw', None)
error_kw = {} if error_kw is None else error_kw.copy()
ezorder = error_kw.pop('zorder', None)
if ezorder is None:
ezorder = kwargs.get('zorder', None)
Expand Down Expand Up @@ -2550,9 +2551,8 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",

error_kw.setdefault("label", '_nolegend_')

errorbar = self.errorbar(ex, ey,
yerr=yerr, xerr=xerr,
fmt='none', **error_kw)
errorbar = self.errorbar(ex, ey, yerr=yerr, xerr=xerr, fmt='none',
**error_kw)
else:
errorbar = None

Expand Down