8000 FIX: in errorbar discard any kwargs which have None value by tacaswell · Pull Request #8037 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

FIX: in errorbar discard any kwargs which have None value #8037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2017
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
8000
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
0