make_random_cmap#
- photutils.utils.make_random_cmap(ncolors=256, seed=None)[source]#
Make a matplotlib colormap consisting of (random) muted colors.
A random colormap is very useful for plotting segmentation images.
- Parameters:
- ncolorsint, optional
The number of colors in the colormap. The default is 256.
- seedint, optional
A seed to initialize the
numpy.random.BitGenerator
. IfNone
, then fresh, unpredictable entropy will be pulled from the OS. Separate function calls with the sameseed
will generate the same colormap.
- Returns:
- cmap
matplotlib.colors.ListedColormap
The matplotlib colormap with random colors in RGBA format.
- cmap