Created
December 3, 2013 22:37
-
-
Save andrewjesaitis/7778867 to your computer and use it in GitHub Desktop.
Just an example of dividing a continuous matplotlib colormap into a distinct array of colors
This file contains hidden or 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 as mpl | |
num_colors = len(values) | |
cm = mpl.cm.get_cmap(name='YlGnBu_r') | |
currentColors = [cm(1.*i/num_colors) for i in range(num_colors)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment