Bases: ListedColormap
, _Colormap
Replacement for ListedColormap
.
colors (sequence of color-spec
, optional) – The colormap colors.
name (str
, default: '_no_name'
) – The colormap name.
N (int
, default: len(colors)
) – The number of levels. 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.
**kwargs – Passed to ListedColormap
.
Methods Summary
append
(*args[, name, N])
Append arbitrary colormaps onto this colormap.
concatenate
(*[, new_obj, message])
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.
truncated
(*[, new_obj, message])
updated
(*[, new_obj, message])
Methods Documentation
Append arbitrary colormaps onto this colormap.
*args – Instances of DiscreteColormap
.
name (str
, optional) – The new colormap name. Default is to merge each name with underscores and prepend a leading underscore, for example _name1_name2
.
N (int
, optional) – The number of points in the colormap lookup table. Default is the number of colors in the concatenated lists.
**kwargs – Passed to copy
.
Return a new colormap with relevant properties copied from this one if they were not provided as keyword arguments.
name (str
, default: '_name_copy'
) – The new colormap name.
colors, N, alpha (optional) – See DiscreteColormap
. If not provided, these are copied from the current colormap.
Load color cycle from a file.
path (path-like) – The file path. Valid file extensions are shown in the below table.
Extension
Description
.hex
Comma-delimited list of HEX strings.
.rgb
, .txt
3-4 column table of channel values.
warn_on_failure (bool
, optional) – If True
, issue a warning when loading fails instead of raising an error.
Return a reversed version of the colormap.
name (str
, default: '_name_r'
) – The new colormap name.
**kwargs – Passed to DiscreteColormap.copy
Save the colormap data to a file.
path (path-like, optional) – The output filename. If not provided, the colormap is saved in the cycles
subfolder in user_folder()
under the filename name.hex
(where name
is the color cycle name). Valid extensions are described in the below table.
Extension
Description
.hex
Comma-delimited list of HEX strings.
.rgb
, .txt
3-4 column table of channel values.
alpha (bool
, optional) – Whether to include an opacity column for .rgb
and .txt
files.
Set the opacity for the entire colormap.
alpha (float
) – The opacity.
Return a cyclically shifted version of the colormap.
Return a truncated version of the colormap.
left (float
, default: None
) – The colormap index for the new “leftmost” color. Must fall between 0
and self.N
. For example, left=2
drops the first two colors.
right (float
, default: None
) – The colormap index for the new “rightmost” color. Must fall between 0
and self.N
. For example, right=4
keeps the first four colors.
name (str
, default: '_name_copy'
) – The new colormap name.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4