@@ -2756,8 +2756,6 @@ def ticklabel_format(self, *, axis='both', style='', scilimits=None,
2756
2756
sb = True
2757
2757
elif style == 'plain' :
2758
2758
sb = False
2759
- elif style == 'comma' :
2760
- raise NotImplementedError ("comma style remains to be added" )
2761
2759
elif style == '' :
2762
2760
sb = None
2763
2761
else :
@@ -3028,7 +3026,8 @@ def _validate_converted_limits(self, limit, convert):
3028
3026
raise ValueError ("Axis limits cannot be NaN or Inf" )
3029
3027
return converted_limit
3030
3028
3031
- def set_xlim (self , left = None , right = None , emit = True , auto = False , ** kw ):
3029
+ def set_xlim (self , left = None , right = None , emit = True , auto = False ,
3030
+ * , xmin = None , xmax = None ):
3032
3031
"""
3033
3032
Set the data limits for the x-axis
3034
3033
@@ -3039,6 +3038,9 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw):
3039
3038
left : scalar, optional
3040
3039
The left xlim (default: None, which leaves the left limit
3041
3040
unchanged).
3041
+ The left and right xlims may be passed as the tuple
3042
+ (`left`, `right`) as the first positional argument (or as
3043
+ the `left` keyword argument).
3042
3044
3043
3045
right : scalar, optional
3044
3046
The right xlim (default: None, which leaves the right limit
@@ -3051,10 +3053,11 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw):
3051
3053
Whether to turn on autoscaling of the x-axis. True turns on,
3052
3054
False turns off (default action), None leaves unchanged.
3053
3055
3054
- xlimits : tuple, optional
3055
- The left and right xlims may be passed as the tuple
3056
- (`left`, `right`) as the first positional argument (or as
3057
- the `left` keyword argument).
3056
+ xmin, xmax : scalar, optional
3057
+ These arguments are deprecated and will be removed in a future
3058
+ version. They are equivalent to left and right respectively,
3059
+ and it is an error to pass both `xmin` and `left` or
3060
+ `xmax` and `right`.
3058
3061
3059
3062
Returns
3060
3063
-------
@@ -3085,15 +3088,20 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw):
3085
3088
>>> set_xlim(5000, 0)
3086
3089
3087
3090
"""
3088
- if 'xmin' in kw :
3089
- left = kw .pop ('xmin' )
3090
- if 'xmax' in kw :
3091
- right = kw .pop ('xmax' )
3092
- if kw :
3093
- raise ValueError ("unrecognized kwargs: %s" % list (kw ))
3094
-
3095
3091
if right is None and iterable (left ):
3096
3092
left , right = left
3093
+ if xmin is not None :
3094
+ cbook .warn_deprecated ('3.0' , name = '`xmin`' ,
3095
+ alternative = '`left`' , obj_type = 'argument' )
3096
+ if left is not None :
3097
+ raise TypeError ('Cannot pass both `xmin` and `left`' )
3098
+ left = xmin
3099
+ if xmax is not None :
3100
+ cbook .warn_deprecated ('3.0' , name = '`xmax`' ,
3101
+ alternative = '`right`' , obj_type = 'argument' )
3102
+ if right is not None :
3103
+ raise TypeError ('Cannot pass both `xmax` and `right`' )
3104
+ right = xmax
3097
3105
3098
3106
self ._process_unit_info (xdata = (left , right ))
3099
3107
left = self ._validate_converted_limits (left , self .convert_xunits )
@@ -3358,7 +3366,8 @@ def get_ylim(self):
3358
3366
"""
3359
3367
return tuple (self .viewLim .intervaly )
3360
3368
3361
- def set_ylim (self , bottom = None , top = None , emit = True , auto = False , ** kw ):
3369
+ def set_ylim (self , bottom = None , top = None , emit = True , auto = False ,
3370
+ * , ymin = None , ymax = None ):
3362
3371
"""
3363
3372
Set the data limits for the y-axis
3364
3373
@@ -3369,6 +3378,9 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False, **kw):
3369
3378
bottom : scalar, optional
3370
3379
The bottom ylim (default: None, which leaves the bottom
3371
3380
limit unchanged).
3381
+ The bottom and top ylims may be passed as the tuple
3382
+ (`bottom`, `top`) as the first positional argument (or as
3383
+ the `bottom` keyword argument).
3372
3384
3373
3385
top : scalar, optional
3374
3386
The top ylim (default: None, which leaves the top limit
@@ -3381,10 +3393,11 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False, **kw):
3381
3393
Whether to turn on autoscaling of the y-axis. True turns on,
3382
3394
False turns off (default action), None leaves unchanged.
3383
3395
3384
- ylimits : tuple, optional
3385
- The bottom and top yxlims may be passed as the tuple
3386
- (`bottom`, `top`) as the first positional argument (or as
3387
- the `bottom` keyword argument).
3396
+ ymin, ymax : scalar, optional
3397
+ These arguments are deprecated and will be removed in a future
3398
+ version. They are equivalent to bottom and top respectively,
3399
+ and it is an error to pass both `xmin` and `bottom` or
3400
+ `xmax` and `top`.
3388
3401
3389
3402
Returns
3390
3403
-------
@@ -3414,15 +3427,20 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False, **kw):
3414
3427
3415
3428
>>> set_ylim(5000, 0)
3416
3429
"""
3417
- if 'ymin' in kw :
3418
- bottom = kw .pop ('ymin' )
3419
- if 'ymax' in kw :
3420
- top = kw .pop ('ymax' )
3421
- if kw :
3422
- raise ValueError ("unrecognized kwargs: %s" % list (kw ))
3423
-
3424
3430
if top is None and iterable (bottom ):
3425
3431
bottom , top = bottom
3432
+ if ymin is not None :
3433
+ cbook .warn_deprecated ('3.0' , name = '`ymin`' ,
3434
+ alternative = '`bottom`' , obj_type = 'argument' )
3435
+ if bottom is not None :
3436
+ raise TypeError ('Cannot pass both `ymin` and `bottom`' )
3437
+ bottom = ymin
3438
+ if ymax is not None :
3439
+ cbook .warn_deprecated ('3.0' , name = '`ymax`' ,
3440
+ alternative = '`top`' , obj_type = 'argument' )
3441
+ if top is not None :
3442
+ raise TypeError ('Cannot pass both `ymax` and `top`' )
3443
+ top = ymax
3426
3444
3427
3445
bottom = self ._validate_converted_limits (bottom , self .convert_yunits )
3428
3446
top = self ._validate_converted_limits (top , self .convert_yunits )
0 commit comments