MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / __init__

Method __init__

lib/matplotlib/colors.py:2419–2451  ·  view source on GitHub ↗

Parameters ---------- vmin, vmax : float or None Values within the range ``[vmin, vmax]`` from the input data will be linearly mapped to ``[0, 1]``. If either *vmin* or *vmax* is not provided, they default to the minimum and maximum values

(self, vmin=None, vmax=None, clip=False)

Source from the content-addressed store, hash-verified

2417 """
2418
2419 def __init__(self, vmin=None, vmax=None, clip=False):
2420 """
2421 Parameters
2422 ----------
2423 vmin, vmax : float or None
2424 Values within the range ``[vmin, vmax]`` from the input data will be
2425 linearly mapped to ``[0, 1]``. If either *vmin* or *vmax* is not
2426 provided, they default to the minimum and maximum values of the input,
2427 respectively.
2428
2429 clip : bool, default: False
2430 Determines the behavior for mapping values outside the range
2431 ``[vmin, vmax]``.
2432
2433 If clipping is off, values outside the range ``[vmin, vmax]`` are
2434 also transformed, resulting in values outside ``[0, 1]``. This
2435 behavior is usually desirable, as colormaps can mark these *under*
2436 and *over* values with specific colors.
2437
2438 If clipping is on, values below *vmin* are mapped to 0 and values
2439 above *vmax* are mapped to 1. Such values become indistinguishable
2440 from regular boundary values, which may cause misinterpretation of
2441 the data.
2442
2443 Notes
2444 -----
2445 If ``vmin == vmax``, input data will be mapped to 0.
2446 """
2447 super().__init__()
2448 self._vmin = _sanitize_extrema(vmin)
2449 self._vmax = _sanitize_extrema(vmax)
2450 self._clip = clip
2451 self._scale = None
2452
2453 @property
2454 def vmin(self):

Callers

nothing calls this directly

Calls 2

_sanitize_extremaFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected