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

Skip to content

Commit 4dd64cf

Browse files
committed
Simplify impl. of polar limits setting API.
AFAICT we can just inherit set_ylim. Also slightly improve the docs of set_rlim.
1 parent 0a8b637 commit 4dd64cf

File tree

1 file changed

+8
-41
lines changed

1 file changed

+8
-41
lines changed

lib/matplotlib/projections/polar.py

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,14 @@ def get_rsign(self):
11751175
@_api.make_keyword_only("3.6", "emit")
11761176
def set_rlim(self, bottom=None, top=None, emit=True, auto=False, **kwargs):
11771177
"""
1178-
See `~.polar.PolarAxes.set_ylim`.
1178+
Set the radial axis view limits.
1179+
1180+
This function behaves like `.Axes.set_ylim`, but additionally supports
1181+
*rmin* and *rmax* as aliases for *bottom* and *top*.
1182+
1183+
See Also
1184+
--------
1185+
.Axes.set_ylim
11791186
"""
11801187
if 'rmin' in kwargs:
11811188
if bottom is None:
@@ -1192,46 +1199,6 @@ def set_rlim(self, bottom=None, top=None, emit=True, auto=False, **kwargs):
11921199
return self.set_ylim(bottom=bottom, top=top, emit=emit, auto=auto,
11931200
**kwargs)
11941201

1195-
@_api.make_keyword_only("3.6", "emit")
1196-
def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
1197-
*, ymin=None, ymax=None):
1198-
"""
1199-
Set the view limits for the radial axis.
1200-
1201-
Parameters
1202-
----------
1203-
bottom : float, optional
1204-
The bottom limit (default: None, which leaves the bottom
1205-
limit unchanged).
1206-
The bottom and top ylims may be passed as the tuple
1207-
(*bottom*, *top*) as the first positional argument (or as
1208-
the *bottom* keyword argument).
1209-
1210-
top : float, optional
1211-
The top limit (default: None, which leaves the top limit
1212-
unchanged).
1213-
1214-
emit : bool, default: True
1215-
Whether to notify observers of limit change.
1216-
1217-
auto : bool or None, default: False
1218-
Whether to turn on autoscaling of the y-axis. True turns on,
1219-
False turns off, None leaves unchanged.
1220-
1221-
ymin, ymax : float, optional
1222-
These arguments are deprecated and will be removed in a future
1223-
version. They are equivalent to *bottom* and *top* respectively,
1224-
and it is an error to pass both *ymin* and *bottom* or
1225-
*ymax* and *top*.
1226-
1227-
Returns
1228-
-------
1229-
bottom, top : (float, float)
1230-
The new y-axis limits in data coordinates.
1231-
"""
1232-
return super().set_ylim(
1233-
bottom, top, emit=emit, auto=auto, ymin=ymin, ymax=ymax)
1234-
12351202
def get_rlabel_position(self):
12361203
"""
12371204
Returns

0 commit comments

Comments
 (0)