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 43b6cde

Browse filesBrowse files
tacaswellMeeseeksDev[bot]
authored andcommitted
Backport PR #12720: Improve docs on Axes scales
1 parent f0dcb17 commit 43b6cde
Copy full SHA for 43b6cde

File tree

Expand file treeCollapse file tree

1 file changed

+42
-28
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+42
-28
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+42-28Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,9 +3270,14 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
32703270
return left, right
32713271

32723272
def get_xscale(self):
3273+
"""
3274+
Return the x-axis scale as string.
3275+
3276+
See Also
3277+
--------
3278+
set_xscale
3279+
"""
32733280
return self.xaxis.get_scale()
3274-
get_xscale.__doc__ = "Return the xaxis scale string: %s""" % (
3275-
", ".join(mscale.get_scale_names()))
32763281

32773282
def set_xscale(self, value, **kwargs):
32783283
"""
@@ -3281,22 +3286,24 @@ def set_xscale(self, value, **kwargs):
32813286
Parameters
32823287
----------
32833288
value : {"linear", "log", "symlog", "logit", ...}
3284-
scaling strategy to apply
3289+
The axis scale type to apply.
32853290
3286-
Notes
3287-
-----
3288-
Different kwargs are accepted, depending on the scale. See
3289-
the `~matplotlib.scale` module for more information.
3290-
3291-
See also
3292-
--------
3293-
matplotlib.scale.LinearScale : linear transform
3291+
**kwargs
3292+
Different keyword arguments are accepted, depending on the scale.
3293+
See the respective class keyword arguments:
32943294
3295-
matplotlib.scale.LogTransform : log transform
3295+
- `matplotlib.scale.LinearScale`
3296+
- `matplotlib.scale.LogScale`
3297+
- `matplotlib.scale.SymmetricalLogScale`
3298+
- `matplotlib.scale.LogitScale`
32963299
3297-
matplotlib.scale.SymmetricalLogTransform : symlog transform
32983300
3299-
matplotlib.scale.LogisticTransform : logit transform
3301+
Notes
3302+
-----
3303+
By default, Matplotlib supports the above mentioned scales.
3304+
Additionally, custom scales may be registered using
3305+
`matplotlib.scale.register_scale`. These scales can then also
3306+
be used here.
33003307
"""
33013308
g = self.get_shared_x_axes()
33023309
for ax in g.get_siblings(self):
@@ -3653,9 +3660,14 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
36533660
return bottom, top
36543661

36553662
def get_yscale(self):
3663+
"""
3664+
Return the x-axis scale as string.
3665+
3666+
See Also
3667+
--------
3668+
set_yscale
3669+
"""
36563670
return self.yaxis.get_scale()
3657-
get_yscale.__doc__ = "Return the yaxis scale string: %s""" % (
3658-
", ".join(mscale.get_scale_names()))
36593671

36603672
def set_yscale(self, value, **kwargs):
36613673
"""
@@ -3664,22 +3676,24 @@ def set_yscale(self, value, **kwargs):
36643676
Parameters
36653677
----------
36663678
value : {"linear", "log", "symlog", "logit", ...}
3667-
scaling strategy to apply
3679+
The axis scale type to apply.
36683680
3669-
Notes
3670-
-----
3671-
Different kwargs are accepted, depending on the scale. See
3672-
the `~matplotlib.scale` module for more information.
3673-
3674-
See also
3675-
--------
3676-
matplotlib.scale.LinearScale : linear transform
3681+
**kwargs
3682+
Different keyword arguments are accepted, depending on the scale.
3683+
See the respective class keyword arguments:
36773684
3678-
matplotlib.scale.LogTransform : log transform
3685+
- `matplotlib.scale.LinearScale`
3686+
- `matplotlib.scale.LogScale`
3687+
- `matplotlib.scale.SymmetricalLogScale`
3688+
- `matplotlib.scale.LogitScale`
36793689
3680-
matplotlib.scale.SymmetricalLogTransform : symlog transform
36813690
3682-
matplotlib.scale.LogisticTransform : logit transform
3691+
Notes
3692+
-----
3693+
By default, Matplotlib supports the above mentioned scales.
3694+
Additionally, custom scales may be registered using
3695+
`matplotlib.scale.register_scale`. These scales can then also
3696+
be used here.
36833697
"""
36843698
g = self.get_shared_y_axes()
36853699
for ax in g.get_siblings(self):

0 commit comments

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