ClippedColormap

class msaexp.utils.ClippedColormap(cmap='Spectral', max_lightness=90, norm=None, vmin=None, vmax=None, **kwargs)[source]

Bases: Colorizer

Color map with Lightness clipped to a maximum value

Parameters
cmapmatplotlib colormap

Colormap object, e.g., matplotlib.cm.Spectral.

max_lightnessfloat

Maximum lightness to allow (0 - 100)

Attributes Summary

N

autoscale

Autoscale the scalar limits on the norm instance using the current array

autoscale_None

Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None

callbacks

changed

Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.

clip

colorbar

get_clim

Return the values (min, max) that are mapped to the colormap limits.

max_lightness

norm

set_clim

Set the norm limits for image scaling.

stale

vmax

vmin

Methods Summary

__call__(x, **kwargs)

Call self as a function.

clip_color_lightness(rgba[, max_lightness])

Clip color to maximum lightness

get_color_lightness(rgba, **kwargs)

Get color Lightness

to_rgba(x[, autoscale, vmin, vmax])

Override the to_rgba method with clipped lightness values

Attributes Documentation

N = 0
autoscale
autoscale_None
callbacks
changed
clip
colorbar = None
get_clim
max_lightness = 90
norm
set_clim
stale
vmax
vmin

Methods Documentation

__call__(x, **kwargs)[source]

Call self as a function.

static clip_color_lightness(rgba, max_lightness=85, **kwargs)[source]

Clip color to maximum lightness

Conversion from https://matplotlib.org/stable/users/explain/colors/colormaps.html

static get_color_lightness(rgba, **kwargs)[source]

Get color Lightness

to_rgba(x, autoscale=False, vmin=None, vmax=None, **kwargs)[source]

Override the to_rgba method with clipped lightness values