Skip to content

Commit dc37c49

Browse files
committed
Merge pull request matplotlib#1675 from megies/errorbar_alpha
fix "alpha" kwarg in errorbar plot
2 parents 5a88d93 + a70108f commit dc37c49

File tree

5 files changed

+174
-77
lines changed

5 files changed

+174
-77
lines changed

lib/matplotlib/axes.py

+4
Original file line numberDiff line numberDiff line change
@@ -5441,6 +5441,8 @@ def errorbar(self, x, y, yerr=None, xerr=None,
54415441
lines_kw['lw']=kwargs['lw']
54425442
if 'transform' in kwargs:
54435443
lines_kw['transform'] = kwargs['transform']
5444+
if 'alpha' in kwargs:
5445+
lines_kw['alpha'] = kwargs['alpha']
54445446
if 'zorder' in kwargs:
54455447
lines_kw['zorder'] = kwargs['zorder']
54465448

@@ -5491,6 +5493,8 @@ def xywhere(xs, ys, mask):
54915493
plot_kw['mew']=kwargs['mew']
54925494
if 'transform' in kwargs:
54935495
plot_kw['transform'] = kwargs['transform']
5496+
if 'alpha' in kwargs:
5497+
plot_kw['alpha'] = kwargs['alpha']
54945498
if 'zorder' in kwargs:
54955499
plot_kw['zorder'] = kwargs['zorder']
54965500

Binary file not shown.
Loading

lib/matplotlib/tests/baseline_images/test_axes/errorbar_mixed.svg

+168-75
Loading

lib/matplotlib/tests/test_axes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -900,8 +900,8 @@ def test_errorbar():
900900
ax.locator_params(nbins=4)
901901

902902
ax = axs[0,1]
903-
ax.errorbar(x, y, xerr=xerr, fmt='o')
904-
ax.set_title('Hor. symmetric')
903+
ax.errorbar(x, y, xerr=xerr, fmt='o', alpha=0.4)
904+
ax.set_title('Hor. symmetric w/ alpha')
905905

906906
ax = axs[1,0]
907907
ax.errorbar(x, y, yerr=[yerr, 2*yerr], xerr=[xerr, 2*xerr], fmt='--o')

0 commit comments

Comments
 (0)