argopy.ArgoColors#

class ArgoColors(name: str = 'Set1', N: int | None = None)[source]#

Class to manage discrete coloring for Argo related variables

Call signatures:

from argopy.plot import ArgoColors

ArgoColors().list_valid_known_colormaps
ArgoColors().known_colormaps.keys()

ArgoColors('data_mode')
ArgoColors('data_mode').cmap
ArgoColors('data_mode').definition

ArgoColors('Set2').cmap
ArgoColors('Spectral', N=25).cmap
__init__(name: str = 'Set1', N: int | None = None)[source]#
Parameters:
  • name (str, default: 'Set1') – Name of the colormap to use.

  • N (int, default: None) – Number of colors to reduce the colormap to. If set to None, use the known quantitative colormap number of colors or fall back on a default 12 value.

Methods

__init__([name, N])

param name:

Name of the colormap to use.

cbar([ticklabels])

Return a colorbar with adjusted tick labels, experimental

show_COLORS()

Generate an HTML representation of the ArgoColors.COLORS palette

to_rgba(range, value)

Return the RGBA color for a given value of the colormap and a range

Attributes

COLORS

Set of Argo colors derived from the logo

cmap

Discrete colormap as matplotlib.colors.LinearSegmentedColormap

definition

Definition of the current known colormap, as a dictionary

list_valid_known_colormaps

List of all known colormaps, including alternative names

lookup

Dictionary with ticks as keys and colors as values

palette

Try to return a seaborn color palette as a list of RGB tuples or matplotlib.colors.ListedColormap

quantitative

Dictionary with number of colors in known quantitative maps

ticklabels

Dictionary with ticks as keys and ticklabels as values