Skip to content

Commit d26581f

Browse files
committed
Include the Norm ABC in the docs
1 parent fc94ae1 commit d26581f

File tree

2 files changed

+7
-36
lines changed

2 files changed

+7
-36
lines changed

doc/api/colors_api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Color norms
2121
:toctree: _as_gen/
2222
:template: autosummary.rst
2323

24+
Norm
2425
Normalize
2526
NoNorm
2627
AsinhNorm

lib/matplotlib/colors.py

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,7 +2311,6 @@ def __call__(self, value, clip=None):
23112311
Notes
23122312
-----
23132313
If not already initialized, ``self.vmin`` and ``self.vmax`` are
2314-
23152314
initialized using ``self.autoscale_None(value)``.
23162315
"""
23172316
pass
@@ -2434,11 +2433,7 @@ def vmax(self, value):
24342433

24352434
@property
24362435
def clip(self):
2437-
"""
2438-
Determines the behavior for mapping values outside the range ``[vmin, vmax]``.
2439-
2440-
See the *clip* parameter in `.Normalize`.
2441-
"""
2436+
# docstring inherited
24422437
return self._clip
24432438

24442439
@clip.setter
@@ -2488,24 +2483,7 @@ def process_value(value):
24882483
return result, is_scalar
24892484

24902485
def __call__(self, value, clip=None):
2491-
"""
2492-
Normalize the data and return the normalized data.
2493-
2494-
Parameters
2495-
----------
2496-
value
2497-
Data to normalize.
2498-
clip : bool, optional
2499-
See the description of the parameter *clip* in `.Normalize`.
2500-
2501-
If ``None``, defaults to ``self.clip`` (which defaults to
2502-
``False``).
2503-
2504-
Notes
2505-
-----
2506-
If not already initialized, ``self.vmin`` and ``self.vmax`` are
2507-
initialized using ``self.autoscale_None(value)``.
2508-
"""
2486+
# docstring inherited
25092487
if clip is None:
25102488
clip = self.clip
25112489

@@ -2535,15 +2513,7 @@ def __call__(self, value, clip=None):
25352513
return result
25362514

25372515
def inverse(self, value):
2538-
"""
2539-
Maps the normalized value (i.e., index in the colormap) back to image
2540-
data value.
2541-
2542-
Parameters
2543-
----------
2544-
value
2545-
Normalized value.
2546-
"""
2516+
# docstring inherited
25472517
if not self.scaled():
25482518
raise ValueError("Not invertible until both vmin and vmax are set")
25492519
(vmin,), _ = self.process_value(self.vmin)
@@ -2556,7 +2526,7 @@ def inverse(self, value):
25562526
return vmin + value * (vmax - vmin)
25572527

25582528
def autoscale(self, A):
2559-
"""Set *vmin*, *vmax* to min, max of *A*."""
2529+
# docstring inherited
25602530
with self.callbacks.blocked():
25612531
# Pause callbacks while we are updating so we only get
25622532
# a single update signal at the end
@@ -2565,7 +2535,7 @@ def autoscale(self, A):
25652535
self._changed()
25662536

25672537
def autoscale_None(self, A):
2568-
"""If *vmin* or *vmax* are not set, use the min/max of *A* to set them."""
2538+
# docstring inherited
25692539
A = np.asanyarray(A)
25702540

25712541
if isinstance(A, np.ma.MaskedArray):
@@ -2579,7 +2549,7 @@ def autoscale_None(self, A):
25792549
self.vmax = A.max()
25802550

25812551
def scaled(self):
2582-
"""Return whether *vmin* and *vmax* are both set."""
2552+
# docstring inherited
25832553
return self.vmin is not None and self.vmax is not None
25842554

25852555

0 commit comments

Comments
 (0)