Skip to content

Commit

Permalink
Merge pull request #3600 from phobson/boxplot-flier-artists
Browse files Browse the repository at this point in the history
BUG : now only set 'marker' and 'color' attribute of fliers in boxplots
  • Loading branch information
tacaswell committed Oct 1, 2014
2 parents b243b2f + c8ae874 commit 6ed0425
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/matplotlib/axes/_axes.py
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Expand Up @@ -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():
Expand Down

0 comments on commit 6ed0425

Please sign in to comment.