ColorDatabase

class ColorDatabase(mapping)[source]

Bases: dict

Dictionary subclass used to replace the builtin matplotlib color database. Permits drawing colors from registered colormaps and color cycles for any plotting command wherever colors are specified. See cache for details.

Parameters

mapping (dict-like) – The colors.

Attributes Summary

cache

A special dictionary subclass capable of retrieving colors "on-the-fly" from registered colormaps and color cycles.

Methods Summary

__setitem__(key, value)

Add a color to the database and clear the cache.