alphapepttools.pl.BaseColormaps#

class alphapepttools.pl.BaseColormaps#

Base colormaps for alphapepttools plots

Attributes table#

Methods table#

get(colormap_name[, n])

Get a default matplotlib.pyplot cmap by name

Attributes#

BaseColormaps.default_colormaps: ClassVar[dict] = {'diverging': <matplotlib.colors.ListedColormap object>, 'diverging_r': <matplotlib.colors.ListedColormap object>, 'magma_clipped': <matplotlib.colors.LinearSegmentedColormap object>, 'sequential': <matplotlib.colors.ListedColormap object>, 'sequential_clipped': <matplotlib.colors.LinearSegmentedColormap object>, 'sequential_r': <matplotlib.colors.ListedColormap object>, 'sequential_r_clipped': <matplotlib.colors.LinearSegmentedColormap object>}#

Methods#

classmethod BaseColormaps.get(colormap_name, n=None)#

Get a default matplotlib.pyplot cmap by name

Optionally, specify the number of colors to be retrieved from the colormap. defaults are set for colormap_name = “sequential” and “diverging”. Otherwise, colormap_name is passed to plt.get_cmap().

Parameters:
  • colormap_name (str) – Name of the colormap to be used

  • n (int, optional) – Number of colors to be retrieved from the colormap. If None, the full colormap is returned.

Return type:

Colormap | list

Returns:

Colormap | list Matplotlib Colormap object or list of colors