Skip to content

Commit fcd7835

Browse files
committed
DOC: Improve module docs of matplotlib.scale
1 parent a18354a commit fcd7835

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

doc/api/scale_api.rst

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
:members:
77
:undoc-members:
88
:show-inheritance:
9+
:member-order: bysource

lib/matplotlib/scale.py

+25-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
"""
22
Scales define the distribution of data values on an axis, e.g. a log scaling.
3-
They are defined as subclasses of `ScaleBase`.
43
5-
See also `.axes.Axes.set_xscale` and the scales examples in the documentation.
4+
The mapping is implemented through `.Transform` subclasses.
65
7-
See :doc:`/gallery/scales/custom_scale` for a full example of defining a custom
8-
scale.
6+
The following scales are builtin:
97
10-
Matplotlib also supports non-separable transformations that operate on both
11-
`~.axis.Axis` at the same time. They are known as projections, and defined in
12-
`matplotlib.projections`.
13-
"""
8+
============= ===================== ================================ =================================
9+
Name Class Transform Inverted transform
10+
============= ===================== ================================ =================================
11+
"asinh" `AsinhScale` `AsinhTransform` `InvertedAsinhTransform`
12+
"function" `FuncScale` `FuncTransform` `FuncTransform`
13+
"functionlog" `FuncScaleLog` `FuncTransform` + `LogTransform` `InvertedLogTransform` + `FuncTransform`
14+
"linear" `LinearScale` `.IdentityTransform` `.IdentityTransform`
15+
"log" `LogScale` `LogTransform` `InvertedLogTransform`
16+
"logit" `LogitScale` `LogitTransform` `LogisticTransform`
17+
"symlog" `SymmetricalLogScale` `SymmetricalLogTransform` `InvertedSymmetricalLogTransform`
18+
============= ===================== ================================ =================================
19+
20+
A user will often only use the scale name, e.g. when setting the scale through
21+
`~.Axes.set_xscale`: ``ax.set_xscale("log")``.
22+
23+
See also the :ref:`scales examples <sphx_glr_gallery_scales>` in the documentation.
24+
25+
Custom scaling can be achieved through `FuncScale`, or by creating your own
26+
`ScaleBase` subclass and corresponding transforms (see :doc:`/gallery/scales/custom_scale`).
27+
Third parties can register their scales by name through `register_scale`.
28+
""" # noqa: E501
1429

1530
import inspect
1631
import textwrap
@@ -412,6 +427,8 @@ class SymmetricalLogScale(ScaleBase):
412427
*linthresh* allows the user to specify the size of this range
413428
(-*linthresh*, *linthresh*).
414429
430+
See :doc:`/gallery/scales/symlog_demo` for a detailed description.
431+
415432
Parameters
416433
----------
417434
base : float, default: 10

0 commit comments

Comments
 (0)