DiscreteColormap¶
- class DiscreteColormap(colors, name=None, N=None, alpha=None, **kwargs)[source]¶
Bases:
matplotlib.colors.ListedColormap,proplot.colors._ColormapReplacement for
ListedColormap.- Parameters
colors (sequence of
color-spec, optional) – The colormap colors.name (
str, optional) – The colormap name. Default is'_no_name'.N (
int, optional) – The number of levels. Default is the length ofcolors. The color list is truncated or wrapped to match this length.alpha (
float, optional) – The opacity for the colormap colors. This overrides the input color opacities.
- Other Parameters
**kwargs – Passed to
ListedColormap.
Methods Summary
append(*args[, name, N])Append arbitrary colormaps onto this colormap.
copy([colors, name, N, alpha])Return a new colormap with relevant properties copied from this one if they were not provided as keyword arguments.
from_file(path, *[, warn_on_failure])Load color cycle from a file.
reversed([name])Return a reversed version of the colormap.
save([path, alpha])Save the colormap data to a file.
set_alpha(alpha)Set the opacity for the entire colormap.
shifted([shift, name])Return a cyclically shifted version of the colormap.
truncate([left, right, name])Return a truncated version of the colormap.