Skip to content

Commit 24caa1b

Browse files
authored
Merge pull request #15735 from anntzer/3ddocs
Cleanup some mplot3d docstrings.
2 parents 40743ae + 676b7ae commit 24caa1b

File tree

1 file changed

+22
-56
lines changed

1 file changed

+22
-56
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 22 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,7 @@ def set_autoscalez_on(self, b):
364364
"""
365365
Set whether autoscaling for the z-axis is applied on plot commands
366366
367-
.. versionadded :: 1.1.0
368-
This function was added, but not tested. Please report any bugs.
367+
.. versionadded:: 1.1.0
369368
370369
Parameters
371370
----------
@@ -382,8 +381,7 @@ def set_zmargin(self, m):
382381
383382
accepts: float in range 0 to 1
384383
385-
.. versionadded :: 1.1.0
386-
This function was added, but not tested. Please report any bugs.
384+
.. versionadded:: 1.1.0
387385
"""
388386
if m < 0 or m > 1:
389387
raise ValueError("margin must be in range 0 to 1")
@@ -427,8 +425,7 @@ def margins(self, *margins, x=None, y=None, z=None, tight=True):
427425
interval will be added to each end of that interval before
428426
it is used in autoscaling.
429427
430-
.. versionadded :: 1.1.0
431-
This function was added, but not tested. Please report any bugs.
428+
.. versionadded:: 1.1.0
432429
"""
433430
if margins and x is not None and y is not None and z is not None:
434431
raise TypeError('Cannot pass both positional and keyword '
@@ -466,8 +463,7 @@ def autoscale(self, enable=True, axis='both', tight=None):
466463
three axes. Therefore, 'z' can be passed for *axis*,
467464
and 'both' applies to all three axes.
468465
469-
.. versionadded :: 1.1.0
470-
This function was added, but not tested. Please report any bugs.
466+
.. versionadded:: 1.1.0
471467
"""
472468
if enable is None:
473469
scalex = True
@@ -785,60 +781,40 @@ def get_zscale(self):
785781

786782
# We need to slightly redefine these to pass scalez=False
787783
# to their calls of autoscale_view.
784+
788785
def set_xscale(self, value, **kwargs):
789786
self.xaxis._set_scale(value, **kwargs)
790787
self.autoscale_view(scaley=False, scalez=False)
791788
self._update_transScale()
792-
if maxes.Axes.set_xscale.__doc__ is not None:
793-
set_xscale.__doc__ = maxes.Axes.set_xscale.__doc__ + """
794-
.. versionadded :: 1.1.0
795-
This function was added, but not tested. Please report any bugs.
796-
"""
789+
self.stale = True
797790

798791
def set_yscale(self, value, **kwargs):
799792
self.yaxis._set_scale(value, **kwargs)
800793
self.autoscale_view(scalex=False, scalez=False)
801794
self._update_transScale()
802795
self.stale = True
803-
if maxes.Axes.set_yscale.__doc__ is not None:
804-
set_yscale.__doc__ = maxes.Axes.set_yscale.__doc__ + """
805-
.. versionadded :: 1.1.0
806-
This function was added, but not tested. Please report any bugs.
807-
"""
808796

809797
def set_zscale(self, value, **kwargs):
798+
self.zaxis._set_scale(value, **kwargs)
799+
self.autoscale_view(scalex=False, scaley=False)
800+
self._update_transScale()
801+
self.stale = True
802+
803+
set_xscale.__doc__, set_yscale.__doc__, set_zscale.__doc__ = map(
810804
"""
811-
Set the z-axis scale.
805+
Set the {}-axis scale.
812806
813807
Parameters
814808
----------
815-
value : {"linear", "log", "symlog", "logit", ...}
816-
The axis scale type to apply.
809+
value : {{"linear"}}
810+
The axis scale type to apply. 3D axes currently only support
811+
linear scales; other scales yield nonsensical results.
817812
818813
**kwargs
819-
Different keyword arguments are accepted, depending on the scale.
820-
See the respective class keyword arguments:
821-
822-
- `matplotlib.scale.LinearScale`
823-
- `matplotlib.scale.LogScale`
824-
- `matplotlib.scale.SymmetricalLogScale`
825-
- `matplotlib.scale.LogitScale`
826-
827-
Notes
828-
-----
829-
Currently, Axes3D objects only supports linear scales.
830-
Other scales may or may not work, and support for these
831-
is improving with each release.
832-
833-
By default, Matplotlib supports the above mentioned scales.
834-
Additionally, custom scales may be registered using
835-
`matplotlib.scale.register_scale`. These scales may then also
836-
be used here as support is added.
837-
"""
838-
self.zaxis._set_scale(value, **kwargs)
839-
self.autoscale_view(scalex=False, scaley=False)
840-
self._update_transScale()
841-
self.stale = True
814+
Keyword arguments are nominally forwarded to the scale class, but
815+
none of them is applicable for linear scales.
816+
""".format,
817+
["x", "y", "z"])
842818

843819
def set_zticks(self, *args, **kwargs):
844820
"""
@@ -1235,19 +1211,13 @@ def get_zlabel(self):
12351211
# Axes rectangle characteristics
12361212

12371213
def get_frame_on(self):
1238-
"""
1239-
Get whether the 3D axes panels are drawn.
1240-
1241-
.. versionadded :: 1.1.0
1242-
"""
1214+
"""Get whether the 3D axes panels are drawn."""
12431215
return self._frameon
12441216

12451217
def set_frame_on(self, b):
12461218
"""
12471219
Set whether the 3D axes panels are drawn.
12481220
1249-
.. versionadded :: 1.1.0
1250-
12511221
Parameters
12521222
----------
12531223
b : bool
@@ -1317,10 +1287,7 @@ def tick_params(self, axis='both', **kwargs):
13171287
accept settings as if it was like the 'y' axis.
13181288
13191289
.. note::
1320-
While this function is currently implemented, the core part
1321-
of the Axes3D object may ignore some of these settings.
1322-
Future releases will fix this. Priority will be given to
1323-
those who file bugs.
1290+
Axes3D currently ignores some of these settings.
13241291
13251292
.. versionadded :: 1.1.0
13261293
"""
@@ -1871,7 +1838,6 @@ def plot_trisurf(self, *args, color=None, norm=None, vmin=None, vmax=None,
18711838
.. plot:: gallery/mplot3d/trisurf3d_2.py
18721839
18731840
.. versionadded:: 1.2.0
1874-
This plotting function was added for the v1.2.0 release.
18751841
"""
18761842

18771843
had_data = self.has_data()

0 commit comments

Comments
 (0)