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

Skip to content

Commit 0a8b637

Browse files
authored
Merge pull request #22415 from anntzer/emitauto
Make emit and auto args of set_{x,y,z}lim keyword only.
2 parents b05de88 + eb7fdfd commit 0a8b637

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*emit* and *auto* parameters of ``set_xlim``, ``set_ylim``, ``set_zlim``, ``set_rlim``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Passing these parameters positionally is deprecated; they will become
4+
keyword-only in a future release.

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3624,6 +3624,7 @@ def _validate_converted_limits(self, limit, convert):
36243624
raise ValueError("Axis limits cannot be NaN or Inf")
36253625
return converted_limit
36263626

3627+
@_api.make_keyword_only("3.6", "emit")
36273628
def set_xlim(self, left=None, right=None, emit=True, auto=False,
36283629
*, xmin=None, xmax=None):
36293630
"""
@@ -3895,6 +3896,7 @@ def get_ylim(self):
38953896
"""
38963897
return tuple(self.viewLim.intervaly)
38973898

3899+
@_api.make_keyword_only("3.6", "emit")
38983900
def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
38993901
*, ymin=None, ymax=None):
39003902
"""

lib/matplotlib/projections/polar.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@ def get_rorigin(self):
11721172
def get_rsign(self):
11731173
return np.sign(self._originViewLim.y1 - self._originViewLim.y0)
11741174

1175+
@_api.make_keyword_only("3.6", "emit")
11751176
def set_rlim(self, bottom=None, top=None, emit=True, auto=False, **kwargs):
11761177
"""
11771178
See `~.polar.PolarAxes.set_ylim`.
@@ -1191,6 +1192,7 @@ def set_rlim(self, bottom=None, top=None, emit=True, auto=False, **kwargs):
11911192
return self.set_ylim(bottom=bottom, top=top, emit=emit, auto=auto,
11921193
**kwargs)
11931194

1195+
@_api.make_keyword_only("3.6", "emit")
11941196
def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
11951197
*, ymin=None, ymax=None):
11961198
"""
@@ -1227,7 +1229,8 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
12271229
bottom, top : (float, float)
12281230
The new y-axis limits in data coordinates.
12291231
"""
1230-
return super().set_ylim(bottom, top, emit, auto, ymin=ymin, ymax=ymax)
1232+
return super().set_ylim(
1233+
bottom, top, emit=emit, auto=auto, ymin=ymin, ymax=ymax)
12311234

12321235
def get_rlabel_position(self):
12331236
"""

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ def get_w_lims(self):
660660
return minx, maxx, miny, maxy, minz, maxz
661661

662662
# set_xlim, set_ylim are directly inherited from base Axes.
663+
@_api.make_keyword_only("3.6", "emit")
663664
def set_zlim(self, bottom=None, top=None, emit=True, auto=False,
664665
*, zmin=None, zmax=None):
665666
"""

0 commit comments

Comments
 (0)