Skip to content

Instantly share code, notes, and snippets.

@jgomezdans
Created May 15, 2010 23:24
Show Gist options
  • Save jgomezdans/402500 to your computer and use it in GitHub Desktop.
Save jgomezdans/402500 to your computer and use it in GitHub Desktop.
Random colormap for matplotli
import matplotlib,numpy
import pylab
# A random colormap for matplotlib
cmap = matplotlib.colors.ListedColormap ( numpy.random.rand ( 256,3))
pylab.imshow ( Z, cmap = cmap)
pylab.show()
@dmenig
Copy link

dmenig commented Feb 3, 2018

hello. If you have a way to perform the same operation in opencv, i'm really interested ! (cmap isn't a proper opencv colormap)

@edwardando
Copy link

edwardando commented Mar 29, 2018

Brilliant, even better than glasbey on ImageJ

@kheffah
Copy link

kheffah commented Jul 2, 2018

This is awesome, very helpful. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment