@@ -2927,7 +2927,7 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5,
29272927
29282928 def bxp (self , bxpstats , positions = None , widths = None , vert = True ,
29292929 patch_artist = False , shownotches = False , showmeans = False ,
2930- showcaps = True , boxprops = None , flierprops = None ,
2930+ showcaps = True , showbox = True , boxprops = None , flierprops = None ,
29312931 medianprops = None , meanprops = None , meanline = False ):
29322932
29332933 # lists of artists to be output
@@ -3025,7 +3025,9 @@ def dopatch(xs, ys, **kwargs):
30253025 if widths is None :
30263026 distance = max (positions ) - min (positions )
30273027 widths = [min (0.15 * max (distance , 1.0 ), 0.5 )] * N
3028- elif len (widths ) != len (bxpstats ):
3028+ elif np .isscalar (widths ):
3029+ widths = [widths ] * N
3030+ elif len (widths ) != N :
30293031 raise ValueError (datashape_message .format ("widths" ))
30303032
30313033 if not self ._hold :
@@ -3076,15 +3078,16 @@ def dopatch(xs, ys, **kwargs):
30763078 stats ['q1' ]]
30773079 med_x = [box_left , box_right ]
30783080
3079- # draw the box:
3080- if patch_artist :
3081- boxes .extend (dopatch (
3082- box_x , box_y , ** boxprops
3083- ))
3084- else :
3085- boxes .extend (doplot (
3086- box_x , box_y , ** boxprops
3087- ))
3081+ # maybe draw the box:
3082+ if showbox :
3083+ if patch_artist :
3084+ boxes .extend (dopatch (
3085+ box_x , box_y , ** boxprops
3086+ ))
3087+ else :
3088+ boxes .extend (doplot (
3089+ box_x , box_y , ** boxprops
3090+ ))
30883091
30893092 # draw the whiskers
30903093 whiskers .extend (doplot (
0 commit comments