@@ -3041,8 +3041,11 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
3041
3041
Whether to turn on autoscaling of the x-axis. True turns on,
3042
3042
False turns off (default action), None leaves unchanged.
3043
3043
3044
- ymin, ymax : scalar, optional
3045
- If passed, these arguments override bottom and top respectively.
3044
+ xmin, xmax : scalar, optional
3045
+ These arguments are deprecated and will be removed in a future
3046
+ version. They are equivalent to left and right respectively,
3047
+ and it is an error to pass both `xmin` and `left` or
3048
+ `xmax` and `right`.
3046
3049
3047
3050
Returns
3048
3051
-------
@@ -3076,12 +3079,16 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
3076
3079
if right is None and iterable (left ):
3077
3080
left , right = left
3078
3081
if xmin is not None :
3082
+ cbook .warn_deprecated ('3.0' , name = '`xmin`' ,
3083
+ alternative = '`left`' , obj_type = 'argument' )
3079
3084
if left is not None :
3080
- warnings . warn ( 'xmin=%r overrides left=%r' % ( xmin , left ) )
3085
+ raise TypeError ( 'Cannot pass both ` xmin` and ` left`' )
3081
3086
left = xmin
3082
3087
if xmax is not None :
3088
+ cbook .warn_deprecated ('3.0' , name = '`xmax`' ,
3089
+ alternative = '`right`' , obj_type = 'argument' )
3083
3090
if right is not None :
3084
- warnings . warn ( 'xmax=%r overrides right=%r' % ( xmax , right ) )
3091
+ raise TypeError ( 'Cannot pass both ` xmax` and ` right`' )
3085
3092
right = xmax
3086
3093
3087
3094
self ._process_unit_info (xdata = (left , right ))
@@ -3375,7 +3382,10 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
3375
3382
False turns off (default action), None leaves unchanged.
3376
3383
3377
3384
ymin, ymax : scalar, optional
3378
- If passed, these arguments override bottom and top respectively.
3385
+ These arguments are deprecated and will be removed in a future
3386
+ version. They are equivalent to bottom and top respectively,
3387
+ and it is an error to pass both `xmin` and `bottom` or
3388
+ `xmax` and `top`.
3379
3389
3380
3390
Returns
3381
3391
-------
@@ -3408,12 +3418,16 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
3408
3418
if top is None and iterable (bottom ):
3409
3419
bottom , top = bottom
3410
3420
if ymin is not None :
3421
+ cbook .warn_deprecated ('3.0' , name = '`ymin`' ,
3422
+ alternative = '`bottom`' , obj_type = 'argument' )
3411
3423
if bottom is not None :
3412
- warnings . warn ( 'ymin=%r overrides bottom=%r' % ( ymin , bottom ) )
3424
+ raise TypeError ( 'Cannot pass both ` ymin` and ` bottom`' )
3413
3425
bottom = ymin
3414
3426
if ymax is not None :
3427
+ cbook .warn_deprecated ('3.0' , name = '`ymax`' ,
3428
+ alternative = '`top`' , obj_type = 'argument' )
3415
3429
if top is not None :
3416
- warnings . warn ( 'ymax=%r overrides top=%r' % ( ymax , top ) )
3430
+ raise TypeError ( 'Cannot pass both ` ymax` and ` top`' )
3417
3431
top = ymax
3418
3432
3419
3433
bottom = self ._validate_converted_limits (bottom , self .convert_yunits )
0 commit comments