Created
September 7, 2017 04:27
-
-
Save MatthewJA/5a0a6d75748bf5cb5962cb9d5572a6ce to your computer and use it in GitHub Desktop.
Simple cyclic matplotlib colourmap based on viridis.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Thanks! Just what I needed.