make_random_cmap#
- photutils.utils.make_random_cmap(n_colors=256, seed=None)[source]#
Make a matplotlib colormap consisting of (random) muted colors.
A random colormap is very useful for plotting segmentation images.
- Parameters:
- n_colorsint, optional
The number of colors in the colormap. The default is 256. Must be at least 1.
- 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 sameseedwill generate the same colormap.
- Returns:
- cmap
matplotlib.colors.ListedColormap The matplotlib colormap with random colors in RGBA format.
- cmap