cmap_from_txt

typhon.plots.cmap_from_txt(file, name=None, N=- 1, comments='%')[source]

Import colormap from txt file.

Reads colormap data (RGB/RGBA) from an ASCII file. Values have to be given in [0, 1] range.

Parameters
  • file (str) – Path to txt file.

  • name (str) – Colormap name. Defaults to filename without extension.

  • N (int) – Number of colors. -1 means all colors (i.e., the complete file).

  • comments (str) – Character to start comments with.

Returns

LinearSegmentedColormap.