lib5c.plotters.extendable.legend_extendable_heatmap module

Module for the LegendExtendableHeatmap class, which adds functionality for adding a legend to the extendable heatmap system.

class lib5c.plotters.extendable.legend_extendable_heatmap.LegendExtendableHeatmap(array, grange_x, grange_y=None, colorscale=None, colormap='obs', norm=None)[source]

Bases: lib5c.plotters.extendable.base_extendable_heatmap.BaseExtendableHeatmap

ExtendableHeatmap mixin class providing functionality for adding a legend.

add_legend(colors, **kwargs)[source]

Adds a legend to the ExtendableHeatmap.

Parameters
  • colors (dict) – The entries to add to the legend. Keys should be string labels to use in the legend, and values should be matplotlib colors.

  • kwargs (kwargs) – Will be passed through to ax.legend().

Returns

The newly created Legend.

Return type

matplotlib.legend.Legend