Skip to content

Instantly share code, notes, and snippets.

@andrewjesaitis
Created December 3, 2013 22:37
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewjesaitis/7778867 to your computer and use it in GitHub Desktop.
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
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