From 80085e3f617ea28b0e1c89ee3ce62ede46c5fcc1 Mon Sep 17 00:00:00 2001 From: Paul Hobson Date: Tue, 30 Sep 2014 16:48:49 -0700 Subject: [PATCH] BUG: now only set 'marker' and 'color' attribute of fliers in boxplots --- lib/matplotlib/axes/_axes.py | 12 ++++-------- .../boxplot_mod_artists_after_plotting.png | Bin 0 -> 1529 bytes lib/matplotlib/tests/test_axes.py | 12 ++++++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 lib/matplotlib/tests/baseline_images/test_axes/boxplot_mod_artists_after_plotting.png diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 9bbda6f62fa5..1710f857c50e 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,11 @@ 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 +3318,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 0000000000000000000000000000000000000000..6228c10559d3054d0cd7d608d2b66c0a5f7429de GIT binary patch literal 1529 zcmeAS@N?(olHy`uVBq!ia0y~yU~~YoKX9-C$wJ+|*+7b=*vT`50|;t3QaXTq&H|6f zVg?2_H4tW;FKngEz`#1&)5S5QV$R#UhS|~KGRGc1PSTKbdN0MHa=2CJ z_cnQOwOc&h#t@D z`}xYJGt#$4t>to9Fh7c);X)S!(?%A74%G$+9Y&TUP6YvPhQ_+alGxuMfoUH!z%a<)*C2|fM>lwQ7V5RbCwsx!&z%%*Svnm40Pn(dc$7^JgG9r zuO%}Wze@GJ4Ri|?LKl}KfYAjEc)!abS!>rGXGjalew!3qF7MFbdo$PeKyF*2#$$_Z za?CRV^|NpBVTt2c|B?;v$m;*EioEyt@4MO8WBji_z4+n9?CUmvo+eiQd;M8bU3n_Q zCe!=EYY&^ZKmGFkvaSy^(+Qrwe>Pg?^YhXw*SvnYOJ<+toTnSVm3=>TGGBeOjad0) zhE3aM`gR(WU7pMslJELQ3bYu-Ni*Z7^`XM7P0 z8)nL@;c45tcVE@t*z2)%J9Om#|J?EI^WEP+<1Ba77rZX5-d&w-FJ3+yXxH}oJ-N0_ ze+1kUu&3C&>;jvKcIn$`*gU>o)^aj@S49oJKs(lE*hfQtah23NrwnD1u78 zvTL|(GBqmuwPAzg)u`PO*YC0mBm|d5^B2rclsIM42a3Tfr)OZ_|>vM}_P)U&YN5TT@qL-^|2eo@J*KcW{`uK3 literal 0 HcmV?d00001 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():