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

Skip to content

DOC: Improve module docs of matplotlib.scale #29353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/api/scale_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
:members:
:undoc-members:
:show-inheritance:
:member-order: bysource
33 changes: 25 additions & 8 deletions lib/matplotlib/scale.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
"""
Scales define the distribution of data values on an axis, e.g. a log scaling.
They are defined as subclasses of `ScaleBase`.

See also `.axes.Axes.set_xscale` and the scales examples in the documentation.
The mapping is implemented through `.Transform` subclasses.

See :doc:`/gallery/scales/custom_scale` for a full example of defining a custom
scale.
The following scales are builtin:

Matplotlib also supports non-separable transformations that operate on both
`~.axis.Axis` at the same time. They are known as projections, and defined in
`matplotlib.projections`.
"""
============= ===================== ================================ =================================
Name Class Transform Inverted transform
============= ===================== ================================ =================================
"asinh" `AsinhScale` `AsinhTransform` `InvertedAsinhTransform`
"function" `FuncScale` `FuncTransform` `FuncTransform`
"functionlog" `FuncScaleLog` `FuncTransform` + `LogTransform` `InvertedLogTransform` + `FuncTransform`
"linear" `LinearScale` `.IdentityTransform` `.IdentityTransform`
"log" `LogScale` `LogTransform` `InvertedLogTransform`
"logit" `LogitScale` `LogitTransform` `LogisticTransform`
"symlog" `SymmetricalLogScale` `SymmetricalLogTransform` `InvertedSymmetricalLogTransform`
============= ===================== ================================ =================================

A user will often only use the scale name, e.g. when setting the scale through
`~.Axes.set_xscale`: ``ax.set_xscale("log")``.

See also the :ref:`scales examples <sphx_glr_gallery_scales>` in the documentation.

Custom scaling can be achieved through `FuncScale`, or by creating your own
`ScaleBase` subclass and corresponding transforms (see :doc:`/gallery/scales/custom_scale`).
Third parties can register their scales by name through `register_scale`.
""" # noqa: E501

import inspect
import textwrap
Expand Down Expand Up @@ -412,6 +427,8 @@ class SymmetricalLogScale(ScaleBase):
*linthresh* allows the user to specify the size of this range
(-*linthresh*, *linthresh*).

See :doc:`/gallery/scales/symlog_demo` for a detailed description.

Parameters
----------
base : float, default: 10
Expand Down
Loading