ContinuousColormap¶
- class ContinuousColormap(*args, gamma=1, alpha=None, cyclic=False, **kwargs)[source]¶
Bases:
matplotlib.colors.LinearSegmentedColormap,proplot.colors._ColormapReplacement for
LinearSegmentedColormap.- Parameters
segmentdata (dict-like) – Dictionary containing the keys
'red','green','blue', and (optionally)'alpha'. The shorthands'r','g','b', and'a'are also acceptable. The key values can be callable functions that return channel values given a colormap index, or 3-column arrays indicating the coordinates and channel transitions. Seematplotlib.colors.LinearSegmentedColormapfor a detailed explanation.name (
str, optional) – The colormap name. This can also be passed as the first positional string argument. Default is'_no_name'.N (
int, optional) – Number of points in the colormap lookup table. Default isrc['image.lut']=256.gamma (
float, optional) – Gamma scaling used for the x coordinates.alpha (
float, optional) – The opacity for the entire colormap. This overrides the input opacities.cyclic (
bool, optional) – Whether the colormap is cyclic. IfTrue, this changes how the leftmost and rightmost color levels are selected, andextendcan only be'neither'(a warning will be issued otherwise).
- Other Parameters
**kwargs – Passed to
matplotlib.colors.LinearSegmentedColormap.
Methods Summary
append(*args[, ratios, name, N])Return the concatenation of this colormap with the input colormaps.
copy([name, segmentdata, N, alpha, gamma, ...])Return a new colormap with relevant properties copied from this one if they were not provided as keyword arguments.
cut([cut, name, left, right])Return a version of the colormap with the center "cut out".
from_file(path, *[, warn_on_failure])Load colormap from a file.
from_list(*args, **kwargs)Make a
ContinuousColormapfrom a sequence of colors.reversed([name])Return a reversed copy of the colormap.
save([path, alpha])Save the colormap data to a file.
set_alpha(alpha[, coords, ratios])Set the opacity for the entire colormap or set up an opacity gradation.
set_cyclic(b)Set whether this colormap is "cyclic".
shifted([shift, name])Return a cyclicaly shifted version of the colormap.
to_discrete([samples, name])Convert the
ContinuousColormapto aDiscreteColormapby drawing samples from the colormap.truncate([left, right, name])Return a truncated version of the colormap.