gsplot.LegendEntries#

class LegendEntries(handles, labels, handler_map=None)#

Bases: object

Immutable 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 with handles.

  • 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__(**kwargs)

__subclasshook__

Abstract classes can override this to customize issubclass().