ListedColormap.from_file

classmethod ListedColormap.from_file(path, warn_on_failure=False)[source]

Load color cycle from a file.

Parameters
  • path (str) – The file path. The file extension should be one of the following:

    Extension

    Description

    .hex

    Comma-delimited list of HEX strings.

    .rgb, .txt

    3-4 column table of channel values.

  • warn_on_failure (bool, optional) – If True, issue a warning when loading fails instead of raising an error.