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

Sign up
Appearance settings

Commit 4900eaf

Browse files
committed
DOC: Scale axis parameter
1 parent a5e1f60 commit 4900eaf

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

‎lib/matplotlib/scale.py‎

Lines changed: 41 additions & 3 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
78+
object as first argument. We plan to remove it in the future, because
79+
we want to make a scale object usable by multiple
8080
`~matplotlib.axis.Axis`\es at the same time.
81+
82+
The current recommendation for `.ScaleBase` subclasses is to have the
83+
*axis* parameter for API compatibility, but not make use of it.
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 about to be removed in the future.
245+
It can already now 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,14 @@ 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+
747+
Currently unused.
710748
nonpositive : {'mask', 'clip'}
711749
Determines the behavior for values beyond the open interval ]0, 1[.
712750
They can either be masked as invalid, or clipped to a number very

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /