shamrock.matplotlib.legend#

Legend helpers for plots with a family of curves colored via a colormap sweep (e.g. cmap(i / N)), where a single gradient-swatch legend entry is preferable to one label per curve.

Functions

add_cmap_legend_entry

Add a colormap-gradient swatch entry to ax's legend, optionally combined with normal labeled handles (extra_handles/extra_labels).

Classes

HandlerColormapLine

Legend handler that draws a horizontal colormap gradient swatch.