Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- # Get a list of the colormaps in matplotlib. Ignore the ones that end with
- # '_r' because these are simply reversed versions of ones that don't end
- # with '_r'
- maps = sorted(m for m in plt.cm.datad if not m.endswith("_r"))
- for i,m in enumerate(maps):
- print "exporting colourmap: " + m
- f = open(m,'w')
- cmap=plt.get_cmap(m)
- for i in range(256):
- val = tuple(int(x*255) for x in cmap(i))
- f.write(str(val[0]) + '\t' + str(val[1]) + '\t' + str(val[2]) + '\n')
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement