Skip to content

Commit f3cd9a9

Browse files
committed
FIX errorbar with drawstyle, close #19879
1 parent 4b95489 commit f3cd9a9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3373,6 +3373,11 @@ def errorbar(self, x, y, yerr=None, xerr=None,
33733373
base_style.pop('markevery', None)
33743374
base_style.pop('linestyle', None)
33753375
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)
33763381

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

lib/matplotlib/tests/test_axes.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3437,14 +3437,17 @@ def test_errobar_nonefmt():
34373437
assert np.all(errbar.get_color() == mcolors.to_rgba('C0'))
34383438

34393439

3440-
def test_errorbar_fillstyle():
3441-
# Check that passing 'fillstyle' keyword will not result in errors
3440+
def test_errorbar_fillstyle_drawstyle():
3441+
# Check that passing 'fillstyle' and 'drawstyle' keyword will not
3442+
# result in errors
34423443
x = np.arange(5)
34433444
y = np.arange(5)
34443445

34453446
plotline, _, _ = plt.errorbar(x, y, xerr=1, yerr=1, ls='None',
3446-
marker='s', fillstyle='full')
3447+
marker='s', fillstyle='full',
3448+
drawstyle='steps-mid')
34473449
assert plotline.get_fillstyle() == 'full'
3450+
assert plotline.get_drawstyle() == 'steps-mid'
34483451

34493452

34503453
@check_figures_equal(extensions=['png'])

0 commit comments

Comments
 (0)