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

Skip to content

Commit 3bf9076

Browse files
authored
Merge pull request #12720 from timhoffm/doc-axes-scale
Improve docs on Axes scales
2 parents 4c3c724 + 49585f9 commit 3bf9076

File tree

1 file changed

+42
-28
lines changed

1 file changed

+42
-28
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3248,9 +3248,14 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
32483248
return left, right
32493249

32503250
def get_xscale(self):
3251+
"""
3252+
Return the x-axis scale as string.
3253+
3254+
See Also
3255+
--------
3256+
set_xscale
3257+
"""
32513258
return self.xaxis.get_scale()
3252-
get_xscale.__doc__ = "Return the xaxis scale string: %s""" % (
3253-
", ".join(mscale.get_scale_names()))
32543259

32553260
def set_xscale(self, value, **kwargs):
32563261
"""
@@ -3259,22 +3264,24 @@ def set_xscale(self, value, **kwargs):
32593264
Parameters
32603265
----------
32613266
value : {"linear", "log", "symlog", "logit", ...}
3262-
scaling strategy to apply
3267+
The axis scale type to apply.
32633268
3264-
Notes
3265-
-----
3266-
Different kwargs are accepted, depending on the scale. See
3267-
the `~matplotlib.scale` module for more information.
3268-
3269-
See also
3270-
--------
3271-
matplotlib.scale.LinearScale : linear transform
3269+
**kwargs
3270+
Different keyword arguments are accepted, depending on the scale.
3271+
See the respective class keyword arguments:
32723272
3273-
matplotlib.scale.LogTransform : log transform
3273+
- `matplotlib.scale.LinearScale`
3274+
- `matplotlib.scale.LogScale`
3275+
- `matplotlib.scale.SymmetricalLogScale`
3276+
- `matplotlib.scale.LogitScale`
32743277
3275-
matplotlib.scale.SymmetricalLogTransform : symlog transform
32763278
3277-
matplotlib.scale.LogisticTransform : logit transform
3279+
Notes
3280+
-----
3281+
By default, Matplotlib supports the above mentioned scales.
3282+
Additionally, custom scales may be registered using
3283+
`matplotlib.scale.register_scale`. These scales can then also
3284+
be used here.
32783285
"""
32793286
g = self.get_shared_x_axes()
32803287
for ax in g.get_siblings(self):
@@ -3630,9 +3637,14 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
36303637
return bottom, top
36313638

36323639
def get_yscale(self):
3640+
"""
3641+
Return the x-axis scale as string.
3642+
3643+
See Also
3644+
--------
3645+
set_yscale
3646+
"""
36333647
return self.yaxis.get_scale()
3634-
get_yscale.__doc__ = "Return the yaxis scale string: %s""" % (
3635-
", ".join(mscale.get_scale_names()))
36363648

36373649
def set_yscale(self, value, **kwargs):
36383650
"""
@@ -3641,22 +3653,24 @@ def set_yscale(self, value, **kwargs):
36413653
Parameters
36423654
----------
36433655
value : {"linear", "log", "symlog", "logit", ...}
3644-
scaling strategy to apply
3656+
The axis scale type to apply.
36453657
3646-
Notes
3647-
-----
3648-
Different kwargs are accepted, depending on the scale. See
3649-
the `~matplotlib.scale` module for more information.
3650-
3651-
See also
3652-
--------
3653-
matplotlib.scale.LinearScale : linear transform
3658+
**kwargs
3659+
Different keyword arguments are accepted, depending on the scale.
3660+
See the respective class keyword arguments:
36543661
3655-
matplotlib.scale.LogTransform : log transform
3662+
- `matplotlib.scale.LinearScale`
3663+
- `matplotlib.scale.LogScale`
3664+
- `matplotlib.scale.SymmetricalLogScale`
3665+
- `matplotlib.scale.LogitScale`
36563666
3657-
matplotlib.scale.SymmetricalLogTransform : symlog transform
36583667
3659-
matplotlib.scale.LogisticTransform : logit transform
3668+
Notes
3669+
-----
3670+
By default, Matplotlib supports the above mentioned scales.
3671+
Additionally, custom scales may be registered using
3672+
`matplotlib.scale.register_scale`. These scales can then also
3673+
be used here.
36603674
"""
36613675
g = self.get_shared_y_axes()
36623676
for ax in g.get_siblings(self):

0 commit comments

Comments
 (0)