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

Skip to content

Commit 442049e

Browse files
authored
Merge pull request matplotlib#15006 from timhoffm/deprecate-positional-minor
Deprecate get/set_*ticks minor positional use
2 parents bd98f12 + ccfbcfb commit 442049e

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecations
2+
````````````
3+
Using the parameter ``minor`` to ``get_*ticks()`` / ``set_*ticks()`` as a
4+
positional parameter is deprecated. It will become keyword-only in future
5+
versions.

lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,10 +3269,12 @@ def set_xscale(self, value, **kwargs):
32693269
ax.stale = True
32703270
self._request_autoscale_view(scaley=False)
32713271

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

3277+
@cbook._make_keyword_only("3.2", "minor")
32763278
def set_xticks(self, ticks, minor=False):
32773279
"""
32783280
Set the x ticks with list of *ticks*
@@ -3649,10 +3651,12 @@ def set_yscale(self, value, **kwargs):
36493651
ax.stale = True
36503652
self._request_autoscale_view(scalex=False)
36513653

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

3659+
@cbook._make_keyword_only("3.2", "minor")
36563660
def set_yticks(self, ticks, minor=False):
36573661
"""
36583662
Set the y ticks with list of *ticks*

lib/matplotlib/axes/_secondary_axes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ def apply_aspect(self, position=None):
161161
self._set_lims()
162162
super().apply_aspect(position)
163163

164+
@cbook._make_keyword_only("3.2", "minor")
164165
def set_ticks(self, ticks, minor=False):
165166
"""
166167
Set the x ticks with list of *ticks*

lib/matplotlib/axis.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,6 +1753,7 @@ def set_ticklabels(self, ticklabels, *args, minor=False, **kwargs):
17531753
self.stale = True
17541754
return ret
17551755

1756+
@cbook._make_keyword_only("3.2", "minor")
17561757
def set_ticks(self, ticks, minor=False):
17571758
"""
17581759
Set the locations of the tick marks from sequence ticks

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ def set_zticks(self, *args, **kwargs):
853853
"""
854854
return self.zaxis.set_ticks(*args, **kwargs)
855855

856+
@cbook._make_keyword_only("3.2", "minor")
856857
def get_zticks(self, minor=False):
857858
"""
858859
Return the z ticks as a list of locations

0 commit comments

Comments
 (0)