monet.plots.colorbars

Colorbar helper functions

Functions

cmap_discretize(cmap, N)

Return a discrete colormap from the continuous colormap cmap.

colorbar_index(ncolors, cmap[, minval, ...])

monet.plots.colorbars.cmap_discretize(cmap, N)

Return a discrete colormap from the continuous colormap cmap.

cmap: colormap instance, eg. cm.jet. N: number of colors.

Example

x = resize(arange(100), (5,100)) djet = cmap_discretize(cm.jet, 5) imshow(x, cmap=djet)