@@ -2888,7 +2888,8 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5,
28882888 bootstrap = None , usermedians = None , conf_intervals = None ,
28892889 meanline = False , showmeans = False , showcaps = True ,
28902890 showbox = True , showfliers = True , boxprops = None , labels = None ,
2891- flierprops = None , medianprops = None , meanprops = None ):
2891+ flierprops = None , medianprops = None , meanprops = None ,
2892+ manage_xticks = True ):
28922893 """
28932894 Make a box and whisker plot.
28942895
@@ -3073,14 +3074,15 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5,
30733074 showcaps = showcaps , showbox = showbox ,
30743075 boxprops = boxprops , flierprops = flierprops ,
30753076 medianprops = medianprops , meanprops = meanprops ,
3076- meanline = meanline , showfliers = showfliers )
3077+ meanline = meanline , showfliers = showfliers ,
3078+ manage_xticks = manage_xticks )
30773079 return artists
30783080
30793081 def bxp (self , bxpstats , positions = None , widths = None , vert = True ,
30803082 patch_artist = False , shownotches = False , showmeans = False ,
30813083 showcaps = True , showbox = True , showfliers = True ,
30823084 boxprops = None , flierprops = None , medianprops = None ,
3083- meanprops = None , meanline = False ):
3085+ meanprops = None , meanline = False , manage_xticks = True ):
30843086 """
30853087 Drawing function for box and whisker plots.
30863088
@@ -3090,7 +3092,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
30903092 patch_artist=False, shownotches=False, showmeans=False,
30913093 showcaps=True, showbox=True, showfliers=True,
30923094 boxprops=None, flierprops=None, medianprops=None,
3093- meanprops=None, meanline=False)
3095+ meanprops=None, meanline=False, manage_xticks=True )
30943096
30953097 Make a box and whisker plot for each column of *x* or each
30963098 vector in sequence *x*. The box extends from the lower to
@@ -3169,6 +3171,9 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
31693171 *meanprops*. Not recommended if *shownotches* is also True.
31703172 Otherwise, means will be shown as points.
31713173
3174+ manage_xticks : bool, default = True
3175+ If the function should adjust the xlim and xtick locations.
3176+
31723177 Returns
31733178 -------
31743179
@@ -3403,10 +3408,11 @@ def dopatch(xs, ys, **kwargs):
34033408 setlim = self .set_ylim
34043409 setlabels = self .set_yticklabels
34053410
3406- newlimits = min (positions ) - 0.5 , max (positions ) + 0.5
3407- setlim (newlimits )
3408- setticks (positions )
3409- setlabels (datalabels )
3411+ if manage_xticks :
3412+ newlimits = min (positions ) - 0.5 , max (positions ) + 0.5
3413+ setlim (newlimits )
3414+ setticks (positions )
3415+ setlabels (datalabels )
34103416
34113417 # reset hold status
34123418 self .hold (holdStatus )
0 commit comments