@@ -2756,8 +2756,6 @@ def ticklabel_format(self, *, axis='both', style='', scilimits=None,
27562756 sb = True
27572757 elif style == 'plain' :
27582758 sb = False
2759- elif style == 'comma' :
2760- raise NotImplementedError ("comma style remains to be added" )
27612759 elif style == '' :
27622760 sb = None
27632761 else :
@@ -3028,7 +3026,8 @@ def _validate_converted_limits(self, limit, convert):
30283026 raise ValueError ("Axis limits cannot be NaN or Inf" )
30293027 return converted_limit
30303028
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 ):
30323031 """
30333032 Set the data limits for the x-axis
30343033
@@ -3039,6 +3038,9 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw):
30393038 left : scalar, optional
30403039 The left xlim (default: None, which leaves the left limit
30413040 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).
30423044
30433045 right : scalar, optional
30443046 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):
30513053 Whether to turn on autoscaling of the x-axis. True turns on,
30523054 False turns off (default action), None leaves unchanged.
30533055
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`.
30583061
30593062 Returns
30603063 -------
@@ -3085,15 +3088,20 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw):
30853088 >>> set_xlim(5000, 0)
30863089
30873090 """
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-
30953091 if right is None and iterable (left ):
30963092 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
30973105
30983106 self ._process_unit_info (xdata = (left , right ))
30993107 left = self ._validate_converted_limits (left , self .convert_xunits )
@@ -3358,7 +3366,8 @@ def get_ylim(self):
33583366 """
33593367 return tuple (self .viewLim .intervaly )
33603368
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 ):
33623371 """
33633372 Set the data limits for the y-axis
33643373
@@ -3369,6 +3378,9 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False, **kw):
33693378 bottom : scalar, optional
33703379 The bottom ylim (default: None, which leaves the bottom
33713380 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).
33723384
33733385 top : scalar, optional
33743386 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):
33813393 Whether to turn on autoscaling of the y-axis. True turns on,
33823394 False turns off (default action), None leaves unchanged.
33833395
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`.
33883401
33893402 Returns
33903403 -------
@@ -3414,15 +3427,20 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False, **kw):
34143427
34153428 >>> set_ylim(5000, 0)
34163429 """
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-
34243430 if top is None and iterable (bottom ):
34253431 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
34263444
34273445 bottom = self ._validate_converted_limits (bottom , self .convert_yunits )
34283446 top = self ._validate_converted_limits (top , self .convert_yunits )
0 commit comments