Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3a316b9

Browse filesBrowse files
authored
Merge pull request matplotlib#19948 from dstansby/elinewidth
Allow numpy arrays to be used as elinewidth
2 parents 5288e0c + a392168 commit 3a316b9
Copy full SHA for 3a316b9

File tree

Expand file treeCollapse file tree

2 files changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-1
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3374,7 +3374,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
33743374
# Make the style dict for the line collections (the bars).
33753375
eb_lines_style = {**base_style, 'color': ecolor}
33763376

3377-
if elinewidth:
3377+
if elinewidth is not None:
33783378
eb_lines_style['linewidth'] = elinewidth
33793379
elif 'linewidth' in kwargs:
33803380
eb_lines_style['linewidth'] = kwargs['linewidth']

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3542,6 +3542,13 @@ def test_errorbar_every(fig_test, fig_ref):
35423542
capsize=4, c='C1', fmt='none')
35433543

35443544

3545+
@pytest.mark.parametrize('elinewidth', [[1, 2, 3],
3546+
np.array([1, 2, 3]),
3547+
1])
3548+
def test_errorbar_linewidth_type(elinewidth):
3549+
plt.errorbar([1, 2, 3], [1, 2, 3], yerr=[1, 2, 3], elinewidth=elinewidth)
3550+
3551+
35453552
@image_comparison(['hist_stacked_stepfilled', 'hist_stacked_stepfilled'])
35463553
def test_hist_stacked_stepfilled():
35473554
# make some data

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.