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