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

Skip to content

Commit bd3ce5a

Browse files
timhoffmmeeseeksmachine
authored andcommitted
Backport PR #19888: Fix errorbar drawstyle
1 parent 62d5bf4 commit bd3ce5a

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
@@ -3420,14 +3420,21 @@ def test_errobar_nonefmt():
34203420
assert np.all(errbar.get_color() == mcolors.to_rgba('C0'))
34213421

34223422

3423-
def test_errorbar_fillstyle():
3424-
# Check that passing 'fillstyle' keyword will not result in errors
3423+
def test_errorbar_fillstyle_drawstyle():
3424+
# Check that passing 'fillstyle' and 'drawstyle' keyword will not
3425+
# result in errors
34253426
x = np.arange(5)
34263427
y = np.arange(5)
34273428

34283429
plotline, _, _ = plt.errorbar(x, y, xerr=1, yerr=1, ls='None',
3429-
marker='s', fillstyle='full')
3430+
marker='s', fillstyle='full',
3431+
drawstyle='steps-mid',
3432+
dash_capstyle='round',
3433+
dash_joinstyle='miter',
3434+
solid_capstyle='butt',
3435+
solid_joinstyle='bevel')
34303436
assert plotline.get_fillstyle() == 'full'
3437+
assert plotline.get_drawstyle() == 'steps-mid'
34313438

34323439

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

0 commit comments

Comments
 (0)