cmap_builder.PiecewiseNorm

class cmap_builder.PiecewiseNorm(data_points, clip=False)

Piecewise linear Norm.

Normalizes data into the [0.0, 1.0] interval by performing a piecewise linear interpolation a non-uniform sequence of N data points over the [0-1] interval.

The non-uniform data intervals are mapped to evenly-spaced intervals in the [0-1] interval using piecewise interpolation.

(Class adapted from the matplotlib.colors.Normalize class).

__init__(data_points, clip=False)

Constructor

Parameters
data_points: array-like (1D)

Sequence of data points indicating the data segments to map.

clip: bool

If True values falling outside the data_points range are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If False masked values remain masked.

Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is clip=False.

Methods

__init__(data_points[, clip])

Constructor

autoscale(A)

Set vmin, vmax to min, max of A.

autoscale_None(A)

If vmin or vmax are not set, use the min/max of A to set them.

inverse(value)

process_value(value)

Homogenize the input value for easy and efficient normalization.

scaled()

Return whether vmin and vmax are set.

Attributes

clip

vmax

vmin