Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple cyclic matplotlib colourmap based on viridis.
import matplotlib.cm
import matplotlib.colors
cyclic_viridis = matplotlib.colors.LinearSegmentedColormap.from_list(
'cyclic_viridis',
[(0, matplotlib.cm.viridis.colors[0]),
(0.25, matplotlib.cm.viridis.colors[256 // 3]),
(0.5, matplotlib.cm.viridis.colors[2 * 256 // 3]),
(0.75, matplotlib.cm.viridis.colors[-1]),
(1.0, matplotlib.cm.viridis.colors[0])])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.