Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 92ce41d

Browse files
authored
Merge pull request #19919 from QuLogic/errorbar-sync
Copy errorbar style normalization to 3D
2 parents 0151110 + f9a7217 commit 92ce41d

File tree

3 files changed

+15
-24
lines changed

3 files changed

+15
-24
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,21 +3355,13 @@ def errorbar(self, x, y, yerr=None, xerr=None,
33553355
if ecolor is None:
33563356
ecolor = base_style['color']
33573357

3358-
# Eject any marker information from line format string, as it's not
3358+
# Eject any line-specific information from format string, as it's not
33593359
# needed for bars or caps.
3360-
base_style.pop('marker', None)
3361-
base_style.pop('markersize', None)
3362-
base_style.pop('markerfacecolor', None)
3363-
base_style.pop('markeredgewidth', None)
3364-
base_style.pop('markeredgecolor', None)
3365-
base_style.pop('markevery', None)
3366-
base_style.pop('linestyle', None)
3367-
base_style.pop('fillstyle', None)
3368-
base_style.pop('drawstyle', None)
3369-
base_style.pop('dash_capstyle', None)
3370-
base_style.pop('dash_joinstyle', None)
3371-
base_style.pop('solid_capstyle', None)
3372-
base_style.pop('solid_joinstyle', None)
3360+
for key in ['marker', 'markersize', 'markerfacecolor',
3361+
'markeredgewidth', 'markeredgecolor', 'markevery',
3362+
'linestyle', 'fillstyle', 'drawstyle', 'dash_capstyle',
3363+
'dash_joinstyle', 'solid_capstyle', 'solid_joinstyle']:
3364+
base_style.pop(key, None)
33733365

33743366
# Make the style dict for the line collections (the bars).
33753367
eb_lines_style = {**base_style, 'color': ecolor}

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,9 +3443,9 @@ def test_errobar_nonefmt():
34433443
assert np.all(errbar.get_color() == mcolors.to_rgba('C0'))
34443444

34453445

3446-
def test_errorbar_fillstyle_drawstyle():
3447-
# Check that passing 'fillstyle' and 'drawstyle' keyword will not
3448-
# result in errors
3446+
def test_errorbar_line_specific_kwargs():
3447+
# Check that passing line-specific keyword arguments will not result in
3448+
# errors.
34493449
x = np.arange(5)
34503450
y = np.arange(5)
34513451

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3136,14 +3136,13 @@ def errorbar(self, x, y, z, zerr=None, yerr=None, xerr=None, fmt='',
31363136
if ecolor is None:
31373137
ecolor = base_style['color']
31383138

3139-
# Eject any marker information from line format string, as it's not
3139+
# Eject any line-specific information from format string, as it's not
31403140
# needed for bars or caps.
3141-
base_style.pop('marker', None)
3142-
base_style.pop('markersize', None)
3143-
base_style.pop('markerfacecolor', None)
3144-
base_style.pop('markeredgewidth', None)
3145-
base_style.pop('markeredgecolor', None)
3146-
base_style.pop('linestyle', None)
3141+
for key in ['marker', 'markersize', 'markerfacecolor',
3142+
'markeredgewidth', 'markeredgecolor', 'markevery',
3143+
'linestyle', 'fillstyle', 'drawstyle', 'dash_capstyle',
3144+
'dash_joinstyle', 'solid_capstyle', 'solid_joinstyle']:
3145+
base_style.pop(key, None)
31473146

31483147
# Make the style dict for the line collections (the bars).
31493148
eb_lines_style = {**base_style, 'color': ecolor}

0 commit comments

Comments
 (0)