import matplotlib,numpy import pylab #Generate some example data... From http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_demo.html delta = 0.025 x = numpy.arange(-3.0, 3.0, delta) y = numpy.arange(-2.0, 2.0, delta) X, Y = numpy.meshgrid(x, y) Z1 = pylab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) Z2 = pylab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1) # difference of Gaussians Z = 100.0 * (Z2 - Z1) #This is the random colormap bit random_colormap = matplotlib.colors.ListedColormap ( numpy.random.rand ( 10,3)) #Does it work? pylab.imshow ( Z, cmap = random_colormap) pylab.colorbar() pylab.show()