diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 9bbda6f62fa5..f69fb6649982 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -3062,8 +3062,7 @@ def boxplot(self, x, notch=False, sym=None, vert=True, whis=1.5, if sym == '': # blow away existing dict and make one for invisible markers flierprops = dict(linestyle='none', marker='', - markeredgecolor='none', - markerfacecolor='none') + color='none') # turn the fliers off just to be safe showfliers = False # now process the symbol string @@ -3076,12 +3075,10 @@ def boxplot(self, x, notch=False, sym=None, vert=True, whis=1.5, flierprops['marker'] = marker # if we have a color, use it if color is not None: - flierprops['color'] = color # assume that if color is passed in the user want # filled symbol, if the users want more control use # flierprops - flierprops['markeredgecolor'] = color - flierprops['markerfacecolor'] = color + flierprops['color'] = color # replace medians if necessary: if usermedians is not None: @@ -3320,9 +3317,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True, final_whiskerprops.update(whiskerprops) # set up the default flier properties - final_flierprops = dict(linestyle='none', marker='+', - markeredgecolor='b', - markerfacecolor='none') + final_flierprops = dict(linestyle='none', marker='+', color='blue') # flier (outlier) properties if flierprops is not None: diff --git a/lib/matplotlib/tests/baseline_images/test_axes/boxplot_mod_artists_after_plotting.png b/lib/matplotlib/tests/baseline_images/test_axes/boxplot_mod_artists_after_plotting.png new file mode 100644 index 000000000000..6228c10559d3 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_axes/boxplot_mod_artists_after_plotting.png differ diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 1e9ed41fc245..aa9f9a7d703f 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -1629,6 +1629,18 @@ def test_boxplot_bad_ci_2(): conf_intervals=[[1, 2], [1]]) +@image_comparison(baseline_images=['boxplot_mod_artists_after_plotting'], + remove_text=True, extensions=['png'], + savefig_kwarg={'dpi': 40}) +def test_boxplot_mod_artist_after_plotting(): + x = [0.15, 0.11, 0.06, 0.06, 0.12, 0.56, -0.56] + fig, ax = plt.subplots() + bp = ax.boxplot(x, sym="o") + for key in bp: + for obj in bp[key]: + obj.set_color('green') + + @image_comparison(baseline_images=['violinplot_vert_baseline'], extensions=['png']) def test_vert_violinplot_baseline():