Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 02ef769

Browse files
committed
API: un-deprecate keyword only args to set_xlim, set_ylim
These were originally documented and deprecated in #11137 however in later discussion we learned: - the 'left, right' / 'top, bottom' names don't make sense in the context of non-rectangular plots - we have at least one frustrated user The original names were `xmin, xmax` but were changed to `left, right` in 9ca5db0 (pre 1.0) and the kwarg popping was added for back-compatibility.
1 parent 665cf51 commit 02ef769

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

doc/api/api_changes.rst

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

160161

161162
Improved call signature for ``Axes.margins``

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3145,8 +3145,7 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
31453145
False turns off (default action), None leaves unchanged.
31463146
31473147
xmin, xmax : scalar, optional
3148-
These arguments are deprecated and will be removed in a future
3149-
version. They are equivalent to left and right respectively,
3148+
They are equivalent to left and right respectively,
31503149
and it is an error to pass both *xmin* and *left* or
31513150
*xmax* and *right*.
31523151
@@ -3188,14 +3187,10 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
31883187
if right is None and np.iterable(left):
31893188
left, right = left
31903189
if xmin is not None:
3191-
cbook.warn_deprecated('3.0', name='`xmin`',
3192-
alternative='`left`', obj_type='argument')
31933190
if left is not None:
31943191
raise TypeError('Cannot pass both `xmin` and `left`')
31953192
left = xmin
31963193
if xmax is not None:
3197-
cbook.warn_deprecated('3.0', name='`xmax`',
3198-
alternative='`right`', obj_type='argument')
31993194
if right is not None:
32003195
raise TypeError('Cannot pass both `xmax` and `right`')
32013196
right = xmax
@@ -3529,8 +3524,7 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
35293524
*False* turns off (default action), *None* leaves unchanged.
35303525
35313526
ymin, ymax : scalar, optional
3532-
These arguments are deprecated and will be removed in a future
3533-
version. They are equivalent to bottom and top respectively,
3527+
They are equivalent to bottom and top respectively,
35343528
and it is an error to pass both *ymin* and *bottom* or
35353529
*ymax* and *top*.
35363530
@@ -3571,14 +3565,10 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
35713565
if top is None and np.iterable(bottom):
35723566
bottom, top = bottom
35733567
if ymin is not None:
3574-
cbook.warn_deprecated('3.0', name='`ymin`',
3575-
alternative='`bottom`', obj_type='argument')
35763568
if bottom is not None:
35773569
raise TypeError('Cannot pass both `ymin` and `bottom`')
35783570
bottom = ymin
35793571
if ymax is not None:
3580-
cbook.warn_deprecated('3.0', name='`ymax`',
3581-
alternative='`top`', obj_type='argument')
35823572
if top is not None:
35833573
raise TypeError('Cannot pass both `ymax` and `top`')
35843574
top = ymax

0 commit comments

Comments
 (0)