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