Skip to content

Commit 61cd47c

Browse files
authored
Merge pull request #30404 from timhoffm/doc-scale
DOC: Scale axis parameter
2 parents 40a47e5 + af62ad2 commit 61cd47c

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

lib/matplotlib/scale.py

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,12 @@ def __init__(self, axis):
7575
The following note is for scale implementers.
7676
7777
For back-compatibility reasons, scales take an `~matplotlib.axis.Axis`
78-
object as first argument. However, this argument should not
79-
be used: a single scale object should be usable by multiple
80-
`~matplotlib.axis.Axis`\es at the same time.
78+
object as the first argument.
79+
80+
The current recommendation for `.ScaleBase` subclasses is to have the
81+
*axis* parameter for API compatibility, but not make use of it. This is
82+
because we plan to remove this argument to make a scale object usable
83+
by multiple `~matplotlib.axis.Axis`\es at the same time.
8184
"""
8285

8386
def get_transform(self):
@@ -236,6 +239,12 @@ def __init__(self, axis, functions):
236239
----------
237240
axis : `~matplotlib.axis.Axis`
238241
The axis for the scale.
242+
243+
.. note::
244+
This parameter is unused and will be removed in an imminent release.
245+
It can already be left out because of special preprocessing,
246+
so that ``FuncScale(functions)`` is valid.
247+
239248
functions : (callable, callable)
240249
two-tuple of the forward and inverse functions for the scale.
241250
The forward function must be monotonic.
@@ -336,6 +345,12 @@ def __init__(self, axis=None, *, base=10, subs=None, nonpositive="clip"):
336345
----------
337346
axis : `~matplotlib.axis.Axis`
338347
The axis for the scale.
348+
349+
.. note::
350+
This parameter is unused and about to be removed in the future.
351+
It can already now be left out because of special preprocessing,
352+
so that ``LogScale(base=2)`` is valid.
353+
339354
base : float, default: 10
340355
The base of the logarithm.
341356
nonpositive : {'clip', 'mask'}, default: 'clip'
@@ -485,6 +500,14 @@ class SymmetricalLogScale(ScaleBase):
485500
486501
Parameters
487502
----------
503+
axis : `~matplotlib.axis.Axis`
504+
The axis for the scale.
505+
506+
.. note::
507+
This parameter is unused and about to be removed in the future.
508+
It can already now be left out because of special preprocessing,
509+
so that ``SymmetricalLocSacle(base=2)`` is valid.
510+
488511
base : float, default: 10
489512
The base of the logarithm.
490513
@@ -606,6 +629,14 @@ def __init__(self, axis=None, *, linear_width=1.0,
606629
"""
607630
Parameters
608631
----------
632+
axis : `~matplotlib.axis.Axis`
633+
The axis for the scale.
634+
635+
.. note::
636+
This parameter is unused and about to be removed in the future.
637+
It can already now be left out because of special preprocessing,
638+
so that ``AsinhScale()`` is valid.
639+
609640
linear_width : float, default: 1
610641
The scale parameter (elsewhere referred to as :math:`a_0`)
611642
defining the extent of the quasi-linear region,
@@ -706,7 +737,13 @@ def __init__(self, axis=None, nonpositive='mask', *,
706737
Parameters
707738
----------
708739
axis : `~matplotlib.axis.Axis`
709-
Currently unused.
740+
The axis for the scale.
741+
742+
.. note::
743+
This parameter is unused and about to be removed in the future.
744+
It can already now be left out because of special preprocessing,
745+
so that ``LogitScale()`` is valid.
746+
710747
nonpositive : {'mask', 'clip'}
711748
Determines the behavior for values beyond the open interval ]0, 1[.
712749
They can either be masked as invalid, or clipped to a number very

0 commit comments

Comments
 (0)