@@ -2884,7 +2884,7 @@ def xywhere(xs, ys, mask):
2884
2884
2885
2885
return errorbar_container # (l0, caplines, barcols)
2886
2886
2887
- def boxplot (self , x , notch = False , sym = 'b+' , vert = True , whis = 1.5 ,
2887
+ def boxplot (self , x , notch = False , sym = None , vert = True , whis = 1.5 ,
2888
2888
positions = None , widths = None , patch_artist = False ,
2889
2889
bootstrap = None , usermedians = None , conf_intervals = None ,
2890
2890
meanline = False , showmeans = False , showcaps = True ,
@@ -2920,9 +2920,11 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5,
2920
2920
If False, produces a rectangular box plot.
2921
2921
If True, will produce a notched box plot
2922
2922
2923
- sym : str, default = 'b+'
2923
+ sym : str or None , default = None
2924
2924
The default symbol for flier points.
2925
2925
Enter an empty string ('') if you don't want to show fliers.
2926
+ If `None`, then the fliers default to 'b+' If you want more
2927
+ control use the fliersprop kwarg.
2926
2928
2927
2929
vert : bool, default = True
2928
2930
If True (default), makes the boxes vertical.
@@ -3045,10 +3047,39 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5,
3045
3047
"""
3046
3048
bxpstats = cbook .boxplot_stats (x , whis = whis , bootstrap = bootstrap ,
3047
3049
labels = labels )
3050
+ # make sure we have a dictionary
3048
3051
if flierprops is None :
3049
- flierprops = dict (sym = sym )
3050
- else :
3051
- flierprops ['sym' ] = sym
3052
+ flierprops = dict ()
3053
+ # if non-default sym value, put it into the flier dictionary
3054
+ # the logic for providing the default symbol ('b+') now lives
3055
+ # in bxp in the initial value of final_flierprops
3056
+ # handle all of the `sym` related logic here so we only have to pass
3057
+ # on the flierprops dict.
3058
+ if sym is not None :
3059
+ # no-flier case, which should really be done with
3060
+ # 'showfliers=False' but none-the-less deal with it to keep back
3061
+ # compatibility
3062
+ if sym == '' :
3063
+ # blow away existing dict and make one for invisible markers
3064
+ flierprops = dict (linestyle = 'none' , marker = '' ,
3065
+ markeredgecolor = 'none' ,
3066
+ markerfacecolor = 'none' )
3067
+ # now process the symbol string
3068
+ else :
3069
+ # process the symbol string
3070
+ # discarded linestyle
3071
+ _ , marker , color = _process_plot_format (sym )
3072
+ # if we have a marker, use it
3073
+ if marker is not None :
3074
+ flierprops ['marker' ] = marker
3075
+ # if we have a color, use it
3076
+ if color is not None :
3077
+ flierprops ['color' ] = color
3078
+ # assume that if color is passed in the user want
3079
+ # filled symbol, if the users want more control use
3080
+ # flierprops
3081
+ flierprops ['markeredgecolor' ] = color
3082
+ flierprops ['markerfacecolor' ] = color
3052
3083
3053
3084
# replace medians if necessary:
3054
3085
if usermedians is not None :
@@ -3290,24 +3321,9 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
3290
3321
final_flierprops = dict (linestyle = 'none' , marker = '+' ,
3291
3322
markeredgecolor = 'b' ,
3292
3323
markerfacecolor = 'none' )
3324
+
3293
3325
# flier (outlier) properties
3294
3326
if flierprops is not None :
3295
- sym = flierprops .pop ('sym' , None )
3296
-
3297
- # watch inverted logic, checks for non-default
3298
- # value of `sym`
3299
- if not (sym == '' or (sym is None )):
3300
- # process the symbol string
3301
- # discarded linestyle
3302
- _ , marker , color = _process_plot_format (sym )
3303
- if marker is not None :
3304
- flierprops ['marker' ] = marker
3305
- if color is not None :
3306
- flierprops ['color' ] = color
3307
- # assume that if color is passed in the user want
3308
- # filled symbol
3309
- flierprops ['markeredgecolor' ] = color
3310
- flierprops ['markerfacecolor' ] = color
3311
3327
final_flierprops .update (flierprops )
3312
3328
3313
3329
# median line properties
0 commit comments