@@ -2875,7 +2875,8 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5,
28752875 bootstrap = None , usermedians = None , conf_intervals = None ,
28762876 meanline = False , showmeans = False , showcaps = True ,
28772877 showbox = True , showfliers = True , boxprops = None , labels = None ,
2878- flierprops = None , medianprops = None , meanprops = None ):
2878+ flierprops = None , medianprops = None , meanprops = None ,
2879+ manage_xticks = True ):
28792880 """
28802881 Make a box and whisker plot.
28812882
@@ -3060,14 +3061,15 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5,
30603061 showcaps = showcaps , showbox = showbox ,
30613062 boxprops = boxprops , flierprops = flierprops ,
30623063 medianprops = medianprops , meanprops = meanprops ,
3063- meanline = meanline , showfliers = showfliers )
3064+ meanline = meanline , showfliers = showfliers ,
3065+ manage_xticks = manage_xticks )
30643066 return artists
30653067
30663068 def bxp (self , bxpstats , positions = None , widths = None , vert = True ,
30673069 patch_artist = False , shownotches = False , showmeans = False ,
30683070 showcaps = True , showbox = True , showfliers = True ,
30693071 boxprops = None , flierprops = None , medianprops = None ,
3070- meanprops = None , meanline = False ):
3072+ meanprops = None , meanline = False , manage_xticks = True ):
30713073 """
30723074 Drawing function for box and whisker plots.
30733075
@@ -3077,7 +3079,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
30773079 patch_artist=False, shownotches=False, showmeans=False,
30783080 showcaps=True, showbox=True, showfliers=True,
30793081 boxprops=None, flierprops=None, medianprops=None,
3080- meanprops=None, meanline=False)
3082+ meanprops=None, meanline=False, manage_xticks=True )
30813083
30823084 Make a box and whisker plot for each column of *x* or each
30833085 vector in sequence *x*. The box extends from the lower to
@@ -3156,6 +3158,9 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
31563158 *meanprops*. Not recommended if *shownotches* is also True.
31573159 Otherwise, means will be shown as points.
31583160
3161+ manage_xticks : bool, default = True
3162+ If the function should adjust the xlim and xtick locations.
3163+
31593164 Returns
31603165 -------
31613166
@@ -3390,10 +3395,11 @@ def dopatch(xs, ys, **kwargs):
33903395 setlim = self .set_ylim
33913396 setlabels = self .set_yticklabels
33923397
3393- newlimits = min (positions ) - 0.5 , max (positions ) + 0.5
3394- setlim (newlimits )
3395- setticks (positions )
3396- setlabels (datalabels )
3398+ if manage_xticks :
3399+ newlimits = min (positions ) - 0.5 , max (positions ) + 0.5
3400+ setlim (newlimits )
3401+ setticks (positions )
3402+ setlabels (datalabels )
33973403
33983404 # reset hold status
33993405 self .hold (holdStatus )
0 commit comments