serpentTools.utils.plot.addColorbar

serpentTools.utils.plot.addColorbar(ax, mappable, norm=None, cbarLabel=None)

Quick utility to add a colorbar to an axes object

The color bar is placed adjacent to the provided axes argument, rather than in the provided space.

Parameters
  • mappable (iterable) – Collection of meshes, patches, or values that are used to construct the colorbar.

  • norm (matplotlib.colors.Normalize, optional) – Normalizer for this plot. Can be a subclass like matplotlib.colors.LogNorm

  • cbarLabel (str, optional) – If given, place this as the y-label for the colorbar

Returns

The colorbar that was added

Return type

matplotlib.colorbar.Colorbar