From 7240abea682589afb35eb73e4b8bada785325d84 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sat, 23 Nov 2019 00:08:27 +0100 Subject: [PATCH] Backport PR #15735: Cleanup some mplot3d docstrings. --- lib/mpl_toolkits/mplot3d/axes3d.py | 78 +++++++++--------------------- 1 file changed, 22 insertions(+), 56 deletions(-) diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index 1c233a00c502..ea42b0409982 100644 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -365,8 +365,7 @@ def set_autoscalez_on(self, b): """ Set whether autoscaling for the z-axis is applied on plot commands - .. versionadded :: 1.1.0 - This function was added, but not tested. Please report any bugs. + .. versionadded:: 1.1.0 Parameters ---------- @@ -383,8 +382,7 @@ def set_zmargin(self, m): accepts: float in range 0 to 1 - .. versionadded :: 1.1.0 - This function was added, but not tested. Please report any bugs. + .. versionadded:: 1.1.0 """ if m < 0 or m > 1: raise ValueError("margin must be in range 0 to 1") @@ -428,8 +426,7 @@ def margins(self, *margins, x=None, y=None, z=None, tight=True): interval will be added to each end of that interval before it is used in autoscaling. - .. versionadded :: 1.1.0 - This function was added, but not tested. Please report any bugs. + .. versionadded:: 1.1.0 """ if margins and x is not None and y is not None and z is not None: raise TypeError('Cannot pass both positional and keyword ' @@ -467,8 +464,7 @@ def autoscale(self, enable=True, axis='both', tight=None): three axes. Therefore, 'z' can be passed for *axis*, and 'both' applies to all three axes. - .. versionadded :: 1.1.0 - This function was added, but not tested. Please report any bugs. + .. versionadded:: 1.1.0 """ if enable is None: scalex = True @@ -795,60 +791,40 @@ def get_zscale(self): # We need to slightly redefine these to pass scalez=False # to their calls of autoscale_view. + def set_xscale(self, value, **kwargs): self.xaxis._set_scale(value, **kwargs) self.autoscale_view(scaley=False, scalez=False) self._update_transScale() - if maxes.Axes.set_xscale.__doc__ is not None: - set_xscale.__doc__ = maxes.Axes.set_xscale.__doc__ + """ - .. versionadded :: 1.1.0 - This function was added, but not tested. Please report any bugs. - """ + self.stale = True def set_yscale(self, value, **kwargs): self.yaxis._set_scale(value, **kwargs) self.autoscale_view(scalex=False, scalez=False) self._update_transScale() self.stale = True - if maxes.Axes.set_yscale.__doc__ is not None: - set_yscale.__doc__ = maxes.Axes.set_yscale.__doc__ + """ - .. versionadded :: 1.1.0 - This function was added, but not tested. Please report any bugs. - """ def set_zscale(self, value, **kwargs): + self.zaxis._set_scale(value, **kwargs) + self.autoscale_view(scalex=False, scaley=False) + self._update_transScale() + self.stale = True + + set_xscale.__doc__, set_yscale.__doc__, set_zscale.__doc__ = map( """ - Set the z-axis scale. + Set the {}-axis scale. Parameters ---------- - value : {"linear", "log", "symlog", "logit", ...} - The axis scale type to apply. + value : {{"linear"}} + The axis scale type to apply. 3D axes currently only support + linear scales; other scales yield nonsensical results. **kwargs - Different keyword arguments are accepted, depending on the scale. - See the respective class keyword arguments: - - - `matplotlib.scale.LinearScale` - - `matplotlib.scale.LogScale` - - `matplotlib.scale.SymmetricalLogScale` - - `matplotlib.scale.LogitScale` - - Notes - ----- - Currently, Axes3D objects only supports linear scales. - Other scales may or may not work, and support for these - is improving with each release. - - By default, Matplotlib supports the above mentioned scales. - Additionally, custom scales may be registered using - `matplotlib.scale.register_scale`. These scales may then also - be used here as support is added. - """ - self.zaxis._set_scale(value, **kwargs) - self.autoscale_view(scalex=False, scaley=False) - self._update_transScale() - self.stale = True + Keyword arguments are nominally forwarded to the scale class, but + none of them is applicable for linear scales. + """.format, + ["x", "y", "z"]) def set_zticks(self, *args, **kwargs): """ @@ -1245,19 +1221,13 @@ def get_zlabel(self): # Axes rectangle characteristics def get_frame_on(self): - """ - Get whether the 3D axes panels are drawn. - - .. versionadded :: 1.1.0 - """ + """Get whether the 3D axes panels are drawn.""" return self._frameon def set_frame_on(self, b): """ Set whether the 3D axes panels are drawn. - .. versionadded :: 1.1.0 - Parameters ---------- b : bool @@ -1327,10 +1297,7 @@ def tick_params(self, axis='both', **kwargs): accept settings as if it was like the 'y' axis. .. note:: - While this function is currently implemented, the core part - of the Axes3D object may ignore some of these settings. - Future releases will fix this. Priority will be given to - those who file bugs. + Axes3D currently ignores some of these settings. .. versionadded :: 1.1.0 """ @@ -1886,7 +1853,6 @@ def plot_trisurf(self, *args, color=None, norm=None, vmin=None, vmax=None, .. plot:: gallery/mplot3d/trisurf3d_2.py .. versionadded:: 1.2.0 - This plotting function was added for the v1.2.0 release. """ had_data = self.has_data()
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: