Skip to content

Make emit and auto args of set_{x,y,z}lim keyword only. #22415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/api/next_api_changes/deprecations/22415-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*emit* and *auto* parameters of ``set_xlim``, ``set_ylim``, ``set_zlim``, ``set_rlim``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Passing these parameters positionally is deprecated; they will become
keyword-only in a future release.
2 changes: 2 additions & 0 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3625,6 +3625,7 @@ def _validate_converted_limits(self, limit, convert):
raise ValueError("Axis limits cannot be NaN or Inf")
return converted_limit

@_api.make_keyword_only("3.6", "emit")
def set_xlim(self, left=None, right=None, emit=True, auto=False,
*, xmin=None, xmax=None):
"""
Expand Down Expand Up @@ -3897,6 +3898,7 @@ def get_ylim(self):
"""
return tuple(self.viewLim.intervaly)

@_api.make_keyword_only("3.6", "emit")
def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
*, ymin=None, ymax=None):
"""
Expand Down
5 changes: 4 additions & 1 deletion lib/matplotlib/projections/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ def get_rorigin(self):
def get_rsign(self):
return np.sign(self._originViewLim.y1 - self._originViewLim.y0)

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

@_api.make_keyword_only("3.6", "emit")
def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
*, ymin=None, ymax=None):
"""
Expand Down Expand Up @@ -1227,7 +1229,8 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
bottom, top : (float, float)
The new y-axis limits in data coordinates.
"""
return super().set_ylim(bottom, top, emit, auto, ymin=ymin, ymax=ymax)
return super().set_ylim(
bottom, top, emit=emit, auto=auto, ymin=ymin, ymax=ymax)

def get_rlabel_position(self):
"""
Expand Down
1 change: 1 addition & 0 deletions lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ def get_w_lims(self):
return minx, maxx, miny, maxy, minz, maxz

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