mdciao.plots.color_dict_guesser¶
-
mdciao.plots.
color_dict_guesser
(colors, keys)¶ Helper function to construct a color dictionary from user input
- Parameters
colors (None, str, list or dict) –
None: use the first
n
“tab10” colors, where n is determined bykeys
str: name of the matplotlib colormap to interpolate to
n
colors. Can be qualitative like “Set2” or “tab20” or quantitative like “viridis” or “Reds”. For more info see: https://matplotlib.org/stable/tutorials/colors/colormaps.htmllist: list of colors ([“r”,”g”,”b”]) Turn this list into a dictionary keyed with
keys
keys (int or list) – If int, create a list of keys = _np.arange(keys). If list, use that list directly as keys for the color dictionary that will be returned
- Returns
colors
- Return type
dict