gsplot.LegendEntries#
- class LegendEntries(handles, labels, handler_map=None)#
Bases:
objectImmutable handles, labels, and local legend handler mappings.
- Parameters:
handles (
collections.abc.Sequence[matplotlib.artist.Artist]) – Native Matplotlib legend handles in display order.labels (
collections.abc.Sequence[str]) – String labels matched one-to-one withhandles.handler_map (
collections.abc.Mapping[Any,matplotlib.legend_handler.HandlerBase] | None) – Local handler mapping copied from the caller.
Notes
The mapping is frozen and is never registered in Matplotlib’s global default handler map.
Examples
>>> import gsplot as gs >>> entries = gs.LegendEntries(handles=(), labels=()) >>> entries.labels ()
- __init__(handles, labels, handler_map=None)#
- Parameters:
handles (Sequence[Artist])
labels (Sequence[str])
handler_map (Mapping[Any, HandlerBase] | None)
- Return type:
None
Methods
__init_subclass__This method is called when a class is subclassed.
__new__(*args, **kwargs)__subclasshook__Abstract classes can override this to customize issubclass().
Attributes
- handler_map: Mapping[Any, HandlerBase] | None#
- handles: Sequence[Artist]#
- labels: Sequence[str]#