static LinearSegmentedColormap.from_file(path, warn_on_failure=False)[source]

Load colormap from a file. Valid file extensions are described in the below table.




List of HEX strings in any format (comma-separated, separate lines, with double quotes… anything goes).’ColorBlind10’:


XML files with <Point .../> entries specifying x, r, g, b, and optionally, a values, where x is the colormap coordinate and the rest are the RGB and opacity (or “alpha”) values.


3-column table delimited by commas or consecutive spaces, each column indicating red, blue and green color values.


As with .rgb, but with 4 columns. The first column indicates the colormap coordinate.

.rgba, .xrgba

As with .rgb, .xrgb, but with a trailing opacity (or “alpha”) column.

  • path (str) – The file path.

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