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

Lines changed: 3 additions & 2 deletions
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``
Lines changed: 5 additions & 0 deletions
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

Lines changed: 2 additions & 12 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy