my_code_base.plot

This module contains various helper functions for plotting.

Submodules

Package Contents

my_code_base.plot.xml_to_cmap(xml)[source]

Convert an XML file to a matplotlib colormap.

Parameters:

xml (str) – The path to the XML file.

Returns:

The generated colormap.

Return type:

matplotlib.colors.LinearSegmentedColormap

Raises:
  • ValueError – If the length of position is not the same as colors.

  • ValueError – If position does not start with 0 and end with 1.

Source: http://schubert.atmos.colostate.edu/~cslocum/custom_cmap.html