Skip to content

Instantly share code, notes, and snippets.

@i-namekawa
Last active September 23, 2015 09:28
Show Gist options
  • Save i-namekawa/4945ff0afacb4a637b60 to your computer and use it in GitHub Desktop.
Save i-namekawa/4945ff0afacb4a637b60 to your computer and use it in GitHub Desktop.
display default MPL colormaps
from pylab import *
val=range(4)
cmaps = [('Sequential', ['Blues', 'BuGn', 'BuPu',
'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd',
'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu',
'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd']),
('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', 'copper',
'gist_heat', 'gray', 'hot', 'pink',
'spring', 'summer', 'winter']),
('Diverging', ['BrBG', 'bwr', 'coolwarm', 'PiYG', 'PRGn', 'PuOr',
'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral',
'seismic']),
('Qualitative', ['Accent', 'Dark2', 'Paired', 'Pastel1',
'Pastel2', 'Set1', 'Set2', 'Set3']),
('Miscellaneous', ['gist_earth', 'terrain', 'ocean', 'gist_stern',
'brg', 'CMRmap', 'cubehelix',
'gnuplot', 'gnuplot2', 'gist_ncar',
'nipy_spectral', 'jet', 'rainbow',
'gist_rainbow', 'hsv', 'flag', 'prism'])]
ioff()
rcParams['text.color'] = 'm'
fig = figure(facecolor='lightgray')
for ncol, (category, _cmaps) in enumerate(cmaps):
for nrow, _cmap in enumerate(_cmaps):
subplot(18,5,nrow*5+ncol+1)
imshow(np.vstack([val,val]), interpolation='none', cmap=_cmap)
axis('off')
title(_cmap)
# tight_layout()
show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment