diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index be58e8137b8d..4e7d4f18b785 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -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: diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index bef80307b61f..4ee4e52e2846 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -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() pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy