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

Commit07f34aa

Browse files
committed
Avoid modifying user input to Axes.bar
The `error_kw` parameter is a dictionary, on which `setdefault` and`pop` are called, which would modify user input.
1 parent787f308 commit07f34aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2434,7 +2434,8 @@ 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',None)
2438+
error_kw= {}iferror_kwisNoneelseerror_kw.copy()
24382439
ezorder=error_kw.pop('zorder',None)
24392440
ifezorderisNone:
24402441
ezorder=kwargs.get('zorder',None)
@@ -2590,9 +2591,8 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
25902591

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp