Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita535924

Browse files
committed
Avoid modifying user input to Axes.bar
The `error_kw` parameter is a dictionary, on which `setdefault` iscalled, which would modify user input.
1 parent787f308 commita535924

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2434,7 +2434,7 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
24342434
# checking and processing will be left to the errorbar method.
24352435
xerr=kwargs.pop('xerr',None)
24362436
yerr=kwargs.pop('yerr',None)
2437-
error_kw=kwargs.pop('error_kw', {})
2437+
error_kw=kwargs.pop('error_kw', {}).copy()
24382438
ezorder=error_kw.pop('zorder',None)
24392439
ifezorderisNone:
24402440
ezorder=kwargs.get('zorder',None)
@@ -2590,9 +2590,8 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
25902590

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

2593-
errorbar=self.errorbar(ex,ey,
2594-
yerr=yerr,xerr=xerr,
2595-
fmt='none',**error_kw)
2593+
errorbar=self.errorbar(ex,ey,yerr=yerr,xerr=xerr,fmt='none',
2594+
**error_kw)
25962595
else:
25972596
errorbar=None
25982597

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp