@@ -2912,7 +2912,7 @@ def locator_params(self, axis='both', tight=None, **kwargs):
29122912
29132913 Parameters
29142914 ----------
2915- axis : {'both', 'x', 'y'}, optional
2915+ axis : {'both', 'x', 'y'}, default: 'both'
29162916 The axis on which to operate.
29172917
29182918 tight : bool or None, optional
@@ -2936,13 +2936,15 @@ def locator_params(self, axis='both', tight=None, **kwargs):
29362936 ax.locator_params(tight=True, nbins=4)
29372937
29382938 """
2939- _x = axis in ['x' , 'both' ]
2940- _y = axis in ['y' , 'both' ]
2941- if _x :
2939+ cbook ._check_in_list (['x' , 'y' , 'both' ], axis = axis )
2940+ update_x = axis in ['x' , 'both' ]
2941+ update_y = axis in ['y' , 'both' ]
2942+ if update_x :
29422943 self .xaxis .get_major_locator ().set_params (** kwargs )
2943- if _y :
2944+ if update_y :
29442945 self .yaxis .get_major_locator ().set_params (** kwargs )
2945- self ._request_autoscale_view (tight = tight , scalex = _x , scaley = _y )
2946+ self ._request_autoscale_view (tight = tight ,
2947+ scalex = update_x , scaley = update_y )
29462948
29472949 def tick_params (self , axis = 'both' , ** kwargs ):
29482950 """Change the appearance of ticks, tick labels, and gridlines.
0 commit comments