Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5599b98

Browse filesBrowse files
committed
Deprecate trying to set minor ticks in 3D
1 parent cee82fb commit 5599b98
Copy full SHA for 5599b98

File tree

Expand file treeCollapse file tree

2 files changed

+50
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+50
-6
lines changed
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecations
2+
````````````
3+
4+
`Axes3D` does not support minor ticks. Passing a ``minor`` parameter to
5+
``set_x/y/zticks`` did not have an effect and is now deprecated.

‎lib/mpl_toolkits/mplot3d/axes3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/axes3d.py
+45-6Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -841,25 +841,64 @@ def set_zscale(self, value, **kwargs):
841841
self._update_transScale()
842842
self.stale = True
843843

844-
def set_zticks(self, *args, **kwargs):
844+
def set_xticks(self, ticks, minor=False):
845845
"""
846-
Set z-axis tick locations.
847-
See :meth:`matplotlib.axes.Axes.set_yticks` for more details.
846+
Set the x-axis tick locations.
848847
849848
.. note::
850-
Minor ticks are not supported.
849+
Minor ticks are not supported by Axes3D objects.
850+
"""
851+
# overridden to remove the non-working 'minor' parameter from the API
852+
if minor is not False:
853+
cbook.warn_deprecated(
854+
"3.2", message="Minor ticks are not supported by Axes3D "
855+
"objects. Passing minor=True will become an "
856+
"error in future versions of matplotlib."
857+
)
858+
return super().set_xticks(ticks)
859+
860+
def set_yticks(self, ticks, minor=False):
861+
"""
862+
Set the y-axis tick locations.
863+
864+
.. note::
865+
Minor ticks are not supported by Axes3D objects.
866+
"""
867+
# overridden to remove the non-working 'minor' parameter from the API
868+
if minor is not False:
869+
cbook.warn_deprecated(
870+
"3.2", message="Minor ticks are not supported by Axes3D "
871+
"objects. Passing minor=True will become an "
872+
"error in future versions of matplotlib."
873+
)
874+
return super().set_yticks(ticks)
875+
876+
def set_zticks(self, ticks, minor=False):
877+
"""
878+
Set the z-axis tick locations.
879+
880+
.. note::
881+
Minor ticks are not supported by Axes3D objects.
851882
852883
.. versionadded:: 1.1.0
853884
"""
854-
return self.zaxis.set_ticks(*args, **kwargs)
885+
if minor is not False:
886+
cbook.warn_deprecated(
887+
"3.2", message="Minor ticks are not supported by Axes3D "
888+
"objects. Passing minor=True will become an "
889+
"error in future versions of matplotlib."
890+
)
891+
ret = self.zaxis.set_ticks(ticks)
892+
self.stale = True
893+
return ret
855894

856895
def get_zticks(self, minor=False):
857896
"""
858897
Return the z ticks as a list of locations
859898
See :meth:`matplotlib.axes.Axes.get_yticks` for more details.
860899
861900
.. note::
862-
Minor ticks are not supported.
901+
Minor ticks are not supported by Axes3D objects.
863902
864903
.. versionadded:: 1.1.0
865904
"""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.