From 4b6f65811a8c828151bed9aa66265a6b46dbb5d5 Mon Sep 17 00:00:00 2001 From: Xianxiang Li Date: Sat, 27 Mar 2021 11:59:05 +0800 Subject: [PATCH] remove fillstyle from eb_lines_style --- lib/matplotlib/axes/_axes.py | 1 + lib/matplotlib/tests/test_axes.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 0f10f4f792cd..6257efae775b 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -3372,6 +3372,7 @@ def errorbar(self, x, y, yerr=None, xerr=None, base_style.pop('markeredgecolor', None) base_style.pop('markevery', None) base_style.pop('linestyle', None) + base_style.pop('fillstyle', None) # Make the style dict for the line collections (the bars). eb_lines_style = {**base_style, 'color': ecolor} diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 2341032dcf84..647410ec7199 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -3437,6 +3437,16 @@ def test_errobar_nonefmt(): assert np.all(errbar.get_color() == mcolors.to_rgba('C0')) +def test_errorbar_fillstyle(): + # Check that passing 'fillstyle' keyword will not result in errors + x = np.arange(5) + y = np.arange(5) + + plotline, _, _ = plt.errorbar(x, y, xerr=1, yerr=1, ls='None', + marker='s', fillstyle='full') + assert plotline.get_fillstyle() == 'full' + + @check_figures_equal(extensions=['png']) def test_errorbar_with_prop_cycle(fig_test, fig_ref): ax = fig_ref.subplots()