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

Skip to content

Commit 5892572

Browse files
authored
Merge pull request #19953 from meeseeksmachine/auto-backport-of-pr-19919-on-v3.4.x
Backport PR #19919 on branch v3.4.x (Copy errorbar style normalization to 3D)
2 parents 5a80b8e + a149258 commit 5892572

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
@@ -3363,21 +3363,13 @@ def errorbar(self, x, y, yerr=None, xerr=None,
33633363
if ecolor is None:
33643364
ecolor = base_style['color']
33653365

3366-
# Eject any marker information from line format string, as it's not
3366+
# Eject any line-specific information from format string, as it's not
33673367
# needed for bars or caps.
3368-
base_style.pop('marker', None)
3369-
base_style.pop('markersize', None)
3370-
base_style.pop('markerfacecolor', None)
3371-
base_style.pop('markeredgewidth', None)
3372-
base_style.pop('markeredgecolor', None)
3373-
base_style.pop('markevery', None)
3374-
base_style.pop('linestyle', None)
3375-
base_style.pop('fillstyle', None)
3376-
base_style.pop('drawstyle', None)
3377-
base_style.pop('dash_capstyle', None)
3378-
base_style.pop('dash_joinstyle', None)
3379-
base_style.pop('solid_capstyle', None)
3380-
base_style.pop('solid_joinstyle', None)
3368+
for key in ['marker', 'markersize', 'markerfacecolor',
3369+
'markeredgewidth', 'markeredgecolor', 'markevery',
3370+
'linestyle', 'fillstyle', 'drawstyle', 'dash_capstyle',
3371+
'dash_joinstyle', 'solid_capstyle', 'solid_joinstyle']:
3372+
base_style.pop(key, None)
33813373

33823374
# Make the style dict for the line collections (the bars).
33833375
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
@@ -3420,9 +3420,9 @@ def test_errobar_nonefmt():
34203420
assert np.all(errbar.get_color() == mcolors.to_rgba('C0'))
34213421

34223422

3423-
def test_errorbar_fillstyle_drawstyle():
3424-
# Check that passing 'fillstyle' and 'drawstyle' keyword will not
3425-
# result in errors
3423+
def test_errorbar_line_specific_kwargs():
3424+
# Check that passing line-specific keyword arguments will not result in
3425+
# errors.
34263426
x = np.arange(5)
34273427
y = np.arange(5)
34283428

lib/mpl_toolkits/mplot3d/axes3d.py

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

3201-
# Eject any marker information from line format string, as it's not
3201+
# Eject any line-specific information from format string, as it's not
32023202
# needed for bars or caps.
3203-
base_style.pop('marker', None)
3204-
base_style.pop('markersize', None)
3205-
base_style.pop('markerfacecolor', None)
3206-
base_style.pop('markeredgewidth', None)
3207-
base_style.pop('markeredgecolor', None)
3208-
base_style.pop('linestyle', None)
3203+
for key in ['marker', 'markersize', 'markerfacecolor',
3204+
'markeredgewidth', 'markeredgecolor', 'markevery',
3205+
'linestyle', 'fillstyle', 'drawstyle', 'dash_capstyle',
3206+
'dash_joinstyle', 'solid_capstyle', 'solid_joinstyle']:
3207+
base_style.pop(key, None)
32093208

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

0 commit comments

Comments
 (0)