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])])
@makingwaves27

This comment has been minimized.

Copy link

@makingwaves27 makingwaves27 commented Apr 13, 2021

image
Thanks! Just what I needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment