Skip to content

Commit f030ebe

Browse files
committed
FIX errorbar with drawstyle, close #19879
1 parent bba76b8 commit f030ebe

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-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: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3437,14 +3437,21 @@ 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',
3449+
dash_capstyle='round',
3450+
dash_joinstyle='miter',
3451+
solid_capstyle='butt',
3452+
solid_joinstyle='bevel')
34473453
assert plotline.get_fillstyle() == 'full'
3454+
assert plotline.get_drawstyle() == 'steps-mid'
34483455

34493456

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

0 commit comments

Comments
 (0)