custom_colormap#

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

Return type:

matplotlib.colors.LinearSegmentedColormap object