wntr.graphics.color module

wntr.graphics.color.custom_colormap(N, colors=['blue', 'white', 'red'], name='custom')[source]

Create a custom colormap. Default settings creates a colormap named ‘custom’ which transitions from blue to white to red.

Parameters
  • N (int) – Number of bins in the colormap.

  • colors (list of colors (optional)) – Colors can be specified in any way understandable by matplotlib.colors.ColorConverter.to_rgb().

  • name (str (optional)) – Name of the colormap

Returns

cmap (matplotlib.colors.LinearSegmentedColormap object)

wntr.graphics.color.random_colormap(N, colormap='jet', name='random', seed=None)[source]

Create a random ordered colormap. Default settings creates a colormap named ‘random’ using the jet colormap.

Parameters
  • N (int) – Number of bins in the colormap.

  • colormap (str (optional)) – Name of matplotlib colormap

  • name (str (optional)) – Name of the colormap

Returns

cmap (matplotlib.colors.ListedColormap object)