Skip to content

Deprecate get/set_*ticks minor positional use #15006

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
Aug 9, 2019
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
5 changes: 5 additions & 0 deletions doc/api/next_api_changes/2019-08-08-TH
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Deprecations
````````````
Using the parameter ``minor`` to ``get_*ticks()`` / ``set_*ticks()`` as a
positional parameter is deprecated. It will become keyword-only in future
versions.
4 changes: 4 additions & 0 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3265,10 +3265,12 @@ def set_xscale(self, value, **kwargs):
ax.stale = True
self._request_autoscale_view(scaley=False)

@cbook._make_keyword_only("3.2", "minor")
def get_xticks(self, minor=False):
"""Return the x ticks as a list of locations"""
return self.xaxis.get_ticklocs(minor=minor)

@cbook._make_keyword_only("3.2", "minor")
def set_xticks(self, ticks, minor=False):
"""
Set the x ticks with list of *ticks*
Expand Down Expand Up @@ -3645,10 +3647,12 @@ def set_yscale(self, value, **kwargs):
ax.stale = True
self._request_autoscale_view(scalex=False)

@cbook._make_keyword_only("3.2", "minor")
def get_yticks(self, minor=False):
"""Return the y ticks as a list of locations"""
return self.yaxis.get_ticklocs(minor=minor)

@cbook._make_keyword_only("3.2", "minor")
def set_yticks(self, ticks, minor=False):
"""
Set the y ticks with list of *ticks*
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/axes/_secondary_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def apply_aspect(self, position=None):
self._set_lims()
super().apply_aspect(position)

@cbook._make_keyword_only("3.2", "minor")
def set_ticks(self, ticks, minor=False):
"""
Set the x ticks with list of *ticks*
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,7 @@ def set_ticklabels(self, ticklabels, *args, minor=False, **kwargs):
self.stale = True
return ret

@cbook._make_keyword_only("3.2", "minor")
def set_ticks(self, ticks, minor=False):
"""
Set the locations of the tick marks from sequence ticks
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 @@ -853,6 +853,7 @@ def set_zticks(self, *args, **kwargs):
"""
return self.zaxis.set_ticks(*args, **kwargs)

@cbook._make_keyword_only("3.2", "minor")
def get_zticks(self, minor=False):
"""
Return the z ticks as a list of locations
Expand Down