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

Skip to content

Commit cc9ae2f

Browse files
committed
Don't pass *markevery* to errorbar lines/caps.
That argument is applied to the line, but errorbar masking is determined by *errorevery* (as actual masks), so *markevery* should not be propagated.
1 parent 94d73b7 commit cc9ae2f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3219,6 +3219,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
32193219
base_style.pop('markerfacecolor', None)
32203220
base_style.pop('markeredgewidth', None)
32213221
base_style.pop('markeredgecolor', None)
3222+
base_style.pop('markevery', None)
32223223
base_style.pop('linestyle', None)
32233224

32243225
# Make the style dict for the line collections (the bars).

lib/matplotlib/tests/test_axes.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3390,7 +3390,7 @@ def test_errorbar_with_prop_cycle(fig_test, fig_ref):
33903390

33913391

33923392
@check_figures_equal()
3393-
def test_errorbar_offsets(fig_test, fig_ref):
3393+
def test_errorbar_every(fig_test, fig_ref):
33943394
x = np.linspace(0, 1, 15)
33953395
y = x * (1-x)
33963396
yerr = y/6
@@ -3411,6 +3411,11 @@ def test_errorbar_offsets(fig_test, fig_ref):
34113411
ax_ref.errorbar(x[shift::4], y[shift::4], yerr[shift::4],
34123412
capsize=4, c=color, fmt='none')
34133413

3414+
# Check that markevery is propagated to line, without affecting errorbars.
3415+
ax_test.errorbar(x, y + 0.1, yerr, markevery=(1, 4), capsize=4, fmt='o')
3416+
ax_ref.plot(x[1::4], y[1::4] + 0.1, 'o', zorder=2.1)
3417+
ax_ref.errorbar(x, y + 0.1, yerr, capsize=4, fmt='none')
3418+
34143419

34153420
@image_comparison(['hist_stacked_stepfilled', 'hist_stacked_stepfilled'])
34163421
def test_hist_stacked_stepfilled():

0 commit comments

Comments
 (0)