GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Include the Norm ABC in the docs · matplotlib/matplotlib@5e43a75

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • colors_api.rst
  • lib/matplotlib
    • colors.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/colors_api.rst‎

Copy file name to clipboardExpand all lines: doc/api/colors_api.rst
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
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
Collapse file

‎lib/matplotlib/colors.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.py
+9-39Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,7 @@ def __init__(self):
22642264
"""
22652265
Abstract base class for normalizations.
22662266
2267-
Subclasses include `colors.Normalize` which maps from a scalar to
2267+
Subclasses include `Normalize` which maps from a scalar to
22682268
a scalar. However, this class makes no such requirement, and subclasses may
22692269
support the normalization of multiple variates simultaneously, with
22702270
separate normalization for each variate.
@@ -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
@@ -2410,7 +2409,7 @@ def __init__(self, vmin=None, vmax=None, clip=False):
24102409

24112410
@property
24122411
def vmin(self):
2413-
"""Lower limit of the input data interval; maps to 0."""
2412+
# docstring inherited
24142413
return self._vmin
24152414

24162415
@vmin.setter
@@ -2422,7 +2421,7 @@ def vmin(self, value):
24222421

24232422
@property
24242423
def vmax(self):
2425-
"""Upper limit of the input data interval; maps to 1."""
2424+
# docstring inherited
24262425
return self._vmax
24272426

24282427
@vmax.setter
@@ -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 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.