Skip to content

Commit 06a0485

Browse files
committed
More edits to Normalize docstrings.
1 parent 47cfa35 commit 06a0485

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

lib/matplotlib/colors.py

+14-15
Original file line numberDiff line numberDiff line change
@@ -925,29 +925,28 @@ class Normalize:
925925
A class which, when called, linearly normalizes data into the
926926
``[0.0, 1.0]`` interval.
927927
"""
928+
928929
def __init__(self, vmin=None, vmax=None, clip=False):
929930
"""
930931
Parameters
931932
----------
932-
vmin : scalar
933-
vmax : scalar
934-
clip : bool
933+
vmin, vmax : float or None
934+
If *vmin* and/or *vmax* is not given, they are initialized from the
935+
minimum and maximum value, respectively, of the first input
936+
processed; i.e., ``__call__(A)`` calls ``autoscale_None(A)``.
937+
938+
clip : bool, default: False
935939
If ``True`` values falling outside the range ``[vmin, vmax]``,
936940
are mapped to 0 or 1, whichever is closer, and masked values are
937-
set to 1. If ``False`` masked values remain masked.
941+
set to 1. If ``False`` masked values remain masked.
942+
943+
Clipping silently defeats the purpose of setting the over, under,
944+
and masked colors in a colormap, so it is likely to lead to
945+
surprises; therefore the default is ``clip=False``.
938946
939947
Notes
940948
-----
941-
If neither *vmin* or *vmax* are given, they are initialized from the
942-
minimum and maximum value respectively of the first input
943-
processed. That is, ``__call__(A)`` calls ``autoscale_None(A)``.
944-
Returns 0 if::
945-
946-
vmin==vmax
947-
948-
Clipping silently defeats the purpose of setting the over, under, and
949-
masked colors in a colormap, so it is likely to lead to surprises;
950-
therefore the default is ``clip=False``.
949+
Returns 0 if ``vmin == vmax``.
951950
"""
952951
self.vmin = _sanitize_extrema(vmin)
953952
self.vmax = _sanitize_extrema(vmax)
@@ -965,7 +964,7 @@ def process_value(value):
965964
result : masked array
966965
Masked array with the same shape as *value*.
967966
is_scalar : bool
968-
``True`` if *value* is a scalar.
967+
Whether *value* is a scalar.
969968
970969
Notes
971970
-----

0 commit comments

Comments
 (0)