Skip to content

Commit 7a2ebfa

Browse files
authored
Merge pull request matplotlib#19888 from smartlixx/FIX_errorbar_drawstyle
Fix errorbar drawstyle
2 parents 21ed859 + f030ebe commit 7a2ebfa

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
@@ -3365,6 +3365,11 @@ def errorbar(self, x, y, yerr=None, xerr=None,
33653365
base_style.pop('markevery', None)
33663366
base_style.pop('linestyle', None)
33673367
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)
33683373

33693374
# Make the style dict for the line collections (the bars).
33703375
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
@@ -3443,14 +3443,21 @@ def test_errobar_nonefmt():
34433443
assert np.all(errbar.get_color() == mcolors.to_rgba('C0'))
34443444

34453445

3446-
def test_errorbar_fillstyle():
3447-
# Check that passing 'fillstyle' keyword will not result in errors
3446+
def test_errorbar_fillstyle_drawstyle():
3447+
# Check that passing 'fillstyle' and 'drawstyle' keyword will not
3448+
# result in errors
34483449
x = np.arange(5)
34493450
y = np.arange(5)
34503451

34513452
plotline, _, _ = plt.errorbar(x, y, xerr=1, yerr=1, ls='None',
3452-
marker='s', fillstyle='full')
3453+
marker='s', fillstyle='full',
3454+
drawstyle='steps-mid',
3455+
dash_capstyle='round',
3456+
dash_joinstyle='miter',
3457+
solid_capstyle='butt',
3458+
solid_joinstyle='bevel')
34533459
assert plotline.get_fillstyle() == 'full'
3460+
assert plotline.get_drawstyle() == 'steps-mid'
34543461

34553462

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

0 commit comments

Comments
 (0)