Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2798,6 +2798,9 @@ def errorbar(self, x, y, yerr=None, xerr=None,
.. plot:: mpl_examples/statistics/errorbar_demo.py
"""
kwargs = cbook.normalize_kwargs(kwargs, _alias_map)
# anything that comes in as 'None', drop so the default thing
# happens down stream
kwargs = {k: v for k, v in kwargs.items() if v is not None}
kwargs.setdefault('zorder', 2)

if errorevery < 1:
Expand Down
16 changes: 16 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2365,6 +2365,22 @@ def test_errorbar():
ax.set_title("Simplest errorbars, 0.2 in x, 0.4 in y")


@cleanup
def test_errorbar_colorcycle():

f, ax = plt.subplots()
x = np.arange(10)
y = 2*x

e1, _, _ = ax.errorbar(x, y, c=None)
e2, _, _ = ax.errorbar(x, 2*y, c=None)
ln1, = ax.plot(x, 4*y)

assert mcolors.to_rgba(e1.get_color()) == mcolors.to_rgba('C0')
assert mcolors.to_rgba(e2.get_color()) == mcolors.to_rgba('C1')
assert mcolors.to_rgba(ln1.get_color()) == mcolors.to_rgba('C2')


@cleanup
def test_errorbar_shape():
fig = plt.figure()
Expand Down