Skip to content

Commit 5d23c3f

Browse files
authored
Merge pull request #16018 from meeseeksmachine/auto-backport-of-pr-15735-on-v3.1.x
Backport PR #15735 on branch v3.1.x (Cleanup some mplot3d docstrings.)
2 parents bbdbc7d + 08943bc commit 5d23c3f

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
@@ -802,60 +798,40 @@ def get_zscale(self):
802798

803799
# We need to slightly redefine these to pass scalez=False
804800
# to their calls of autoscale_view.
801+
805802
def set_xscale(self, value, **kwargs):
806803
self.xaxis._set_scale(value, **kwargs)
807804
self.autoscale_view(scaley=False, scalez=False)
808805
self._update_transScale()
809-
if maxes.Axes.set_xscale.__doc__ is not None:
810-
set_xscale.__doc__ = maxes.Axes.set_xscale.__doc__ + """
811-
.. versionadded :: 1.1.0
812-
This function was added, but not tested. Please report any bugs.
813-
"""
806+
self.stale = True
814807

815808
def set_yscale(self, value, **kwargs):
816809
self.yaxis._set_scale(value, **kwargs)
817810
self.autoscale_view(scalex=False, scalez=False)
818811
self._update_transScale()
819812
self.stale = True
820-
if maxes.Axes.set_yscale.__doc__ is not None:
821-
set_yscale.__doc__ = maxes.Axes.set_yscale.__doc__ + """
822-
.. versionadded :: 1.1.0
823-
This function was added, but not tested. Please report any bugs.
824-
"""
825813

826814
def set_zscale(self, value, **kwargs):
815+
self.zaxis._set_scale(value, **kwargs)
816+
self.autoscale_view(scalex=False, scaley=False)
817+
self._update_transScale()
818+
self.stale = True
819+
820+
set_xscale.__doc__, set_yscale.__doc__, set_zscale.__doc__ = map(
827821
"""
828-
Set the z-axis scale.
822+
Set the {}-axis scale.
829823
830824
Parameters
831825
----------
832-
value : {"linear", "log", "symlog", "logit", ...}
833-
The axis scale type to apply.
826+
value : {{"linear"}}
827+
The axis scale type to apply. 3D axes currently only support
828+
linear scales; other scales yield nonsensical results.
834829
835830
**kwargs
836-
Different keyword arguments are accepted, depending on the scale.
837-
See the respective class keyword arguments:
838-
839-
- `matplotlib.scale.LinearScale`
840-
- `matplotlib.scale.LogScale`
841-
- `matplotlib.scale.SymmetricalLogScale`
842-
- `matplotlib.scale.LogitScale`
843-
844-
Notes
845-
-----
846-
Currently, Axes3D objects only supports linear scales.
847-
Other scales may or may not work, and support for these
848-
is improving with each release.
849-
850-
By default, Matplotlib supports the above mentioned scales.
851-
Additionally, custom scales may be registered using
852-
`matplotlib.scale.register_scale`. These scales may then also
853-
be used here as support is added.
854-
"""
855-
self.zaxis._set_scale(value, **kwargs)
856-
self.autoscale_view(scalex=False, scaley=False)
857-
self._update_transScale()
858-
self.stale = True
831+
Keyword arguments are nominally forwarded to the scale class, but
832+
none of them is applicable for linear scales.
833+
""".format,
834+
["x", "y", "z"])
859835

860836
def set_zticks(self, *args, **kwargs):
861837
"""
@@ -1266,19 +1242,13 @@ def get_zlabel(self):
12661242
#### Axes rectangle characteristics
12671243

12681244
def get_frame_on(self):
1269-
"""
1270-
Get whether the 3D axes panels are drawn.
1271-
1272-
.. versionadded :: 1.1.0
1273-
"""
1245+
"""Get whether the 3D axes panels are drawn."""
12741246
return self._frameon
12751247

12761248
def set_frame_on(self, b):
12771249
"""
12781250
Set whether the 3D axes panels are drawn.
12791251
1280-
.. versionadded :: 1.1.0
1281-
12821252
Parameters
12831253
----------
12841254
b : bool
@@ -1406,10 +1376,7 @@ def tick_params(self, axis='both', **kwargs):
14061376
accept settings as if it was like the 'y' axis.
14071377
14081378
.. note::
1409-
While this function is currently implemented, the core part
1410-
of the Axes3D object may ignore some of these settings.
1411-
Future releases will fix this. Priority will be given to
1412-
those who file bugs.
1379+
Axes3D currently ignores some of these settings.
14131380
14141381
.. versionadded :: 1.1.0
14151382
This function was added, but not tested. Please report any bugs.
@@ -1973,7 +1940,6 @@ def plot_trisurf(self, *args, color=None, norm=None, vmin=None, vmax=None,
19731940
.. plot:: gallery/mplot3d/trisurf3d_2.py
19741941
19751942
.. versionadded:: 1.2.0
1976-
This plotting function was added for the v1.2.0 release.
19771943
"""
19781944

19791945
had_data = self.has_data()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy