Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shamrock.matplotlib.legend Namespace Reference

Classes

class  HandlerColormapLine

Functions

 add_cmap_legend_entry (ax, cmap, label, num_stripes=8, extra_handles=None, extra_labels=None, **legend_kwargs)

Variables

bool _HAS_MATPLOTLIB = True

Detailed Description

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.

Function Documentation

◆ add_cmap_legend_entry()

shamrock.matplotlib.legend.add_cmap_legend_entry ( ax,
cmap,
label,
num_stripes = 8,
extra_handles = None,
extra_labels = None,
** legend_kwargs )
Add a colormap-gradient swatch entry to ax's legend, optionally
combined with normal labeled handles (extra_handles/extra_labels).

Definition at line 49 of file legend.py.

Variable Documentation

◆ _HAS_MATPLOTLIB

bool shamrock.matplotlib.legend._HAS_MATPLOTLIB = True
protected

Definition at line 13 of file legend.py.