Bases: Mapping
Container for sequences of colors that are known to Matplotlib by name.
The universal registry instance is matplotlib.color_sequences
. There should be no need for users to instantiate ColorSequenceRegistry
themselves.
Read access uses a dict-like interface mapping names to lists of colors:
import matplotlib as mpl colors = mpl.color_sequences['tab10']
For a list of built in color sequences, see Named color sequences. The returned lists are copies, so that their modification does not change the global definition of the color sequence.
Additional color sequences can be added via ColorSequenceRegistry.register
:
mpl.color_sequences.register('rgb', ['r', 'g', 'b'])
Register a new color sequence.
The color sequence registry stores a copy of the given color_list, so that future changes to the original list do not affect the registered color sequence. Think of this as the registry taking a snapshot of color_list at registration.
The name for the color sequence.
An iterable returning valid Matplotlib colors when iterating over. Note however that the returned color sequence will always be a list regardless of the input type.
Remove a sequence from the registry.
You cannot remove built-in color sequences.
If the name is not registered, returns with no error.
matplotlib.colors.ColorSequenceRegistry
#
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