Skip to content

Commit aa360dc

Browse files
authored
Merge pull request #13425 from tacaswell/dedeprecate_xmin_xmax
API: un-deprecate keyword only args to set_xlim, set_ylim
2 parents 3c380ce + 4e426f3 commit aa360dc

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

doc/api/api_changes.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ Different exception types for undocumented options
156156
and ``right`` arguments. :meth:`~matplotlib.axes.Axes.set_ylim` and the
157157
3D equivalents (e.g. :meth:`~mpl_toolkits.axes.Axes3D.set_zlim3d`) had a
158158
corresponding problem.
159-
The ``_min`` and ``_max`` arguments are now deprecated, and a ``TypeError``
160-
will be raised if they would override the earlier limit arguments.
159+
A ``TypeError`` will be raised if they would override the earlier
160+
limit arguments. In 3.0 these were kwargs were deprecated, but in 3.1
161+
the deprecation was undone.
161162

162163

163164
Improved call signature for ``Axes.margins``
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
De-deprecate xmin, xmax kwargs to set_xlim and ymin, ymax kwargs to set_ylim
2+
````````````````````````````````````````````````````````````````````````````
3+
4+
These kwargs were deprecated in 3.0, but due to user feedback and the
5+
semantics of the new names are problematic for non-rectangular axes.

lib/matplotlib/axes/_base.py

+2-12
Original file line numberDiff line numberDiff line change
@@ -3152,8 +3152,7 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
31523152
False turns off (default action), None leaves unchanged.
31533153
31543154
xmin, xmax : scalar, optional
3155-
These arguments are deprecated and will be removed in a future
3156-
version. They are equivalent to left and right respectively,
3155+
They are equivalent to left and right respectively,
31573156
and it is an error to pass both *xmin* and *left* or
31583157
*xmax* and *right*.
31593158
@@ -3195,14 +3194,10 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
31953194
if right is None and np.iterable(left):
31963195
left, right = left
31973196
if xmin is not None:
3198-
cbook.warn_deprecated('3.0', name='`xmin`',
3199-
alternative='`left`', obj_type='argument')
32003197
if left is not None:
32013198
raise TypeError('Cannot pass both `xmin` and `left`')
32023199
left = xmin
32033200
if xmax is not None:
3204-
cbook.warn_deprecated('3.0', name='`xmax`',
3205-
alternative='`right`', obj_type='argument')
32063201
if right is not None:
32073202
raise TypeError('Cannot pass both `xmax` and `right`')
32083203
right = xmax
@@ -3536,8 +3531,7 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
35363531
*False* turns off (default action), *None* leaves unchanged.
35373532
35383533
ymin, ymax : scalar, optional
3539-
These arguments are deprecated and will be removed in a future
3540-
version. They are equivalent to bottom and top respectively,
3534+
They are equivalent to bottom and top respectively,
35413535
and it is an error to pass both *ymin* and *bottom* or
35423536
*ymax* and *top*.
35433537
@@ -3578,14 +3572,10 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
35783572
if top is None and np.iterable(bottom):
35793573
bottom, top = bottom
35803574
if ymin is not None:
3581-
cbook.warn_deprecated('3.0', name='`ymin`',
3582-
alternative='`bottom`', obj_type='argument')
35833575
if bottom is not None:
35843576
raise TypeError('Cannot pass both `ymin` and `bottom`')
35853577
bottom = ymin
35863578
if ymax is not None:
3587-
cbook.warn_deprecated('3.0', name='`ymax`',
3588-
alternative='`top`', obj_type='argument')
35893579
if top is not None:
35903580
raise TypeError('Cannot pass both `ymax` and `top`')
35913581
top = ymax

0 commit comments

Comments
 (0)