tomodrgn.analysis.get_colors_matplotlib#
- get_colors_matplotlib(num_colors: int, cmap: Colormap | str | None = None) list[tuple[float, float, float, float]] [source]#
Sample num_colors colors from the specified color map as RGBA tuples
- Parameters:
num_colors – the number of colors to sample from the color map. If using a qualitative colormap such as tab10, the first num_colors are sampled sequentially. Otherwise, colors are sampled uniformly and sequentially from one pass over the entire colormap.
cmap – the matplotlib colormap from which to sample colors. See: https://matplotlib.org/stable/users/explain/colors/colormaps.html#classes-of-colormaps
- Returns:
list of RGBA tuples for each color sampled from the color map.