matplotlib 3.5.1

NotesParameters
__init__(self, loc, pad=0.4, borderpad=0.5, child=None, prop=None, frameon=True, bbox_to_anchor=None, bbox_transform=None, **kwargs)

Notes

See .Legend for a detailed description of the anchoring mechanism.

Parameters

loc : str

The box location. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of .Legend for details.

pad : float, default: 0.4

Padding around the child as fraction of the fontsize.

borderpad : float, default: 0.5

Padding between the offsetbox frame and the bbox_to_anchor.

child : `.OffsetBox`

The box that will be anchored.

prop : `.FontProperties`

This is only used as a reference for paddings. If not given, legend.fontsize is used.

frameon : bool

Whether to draw a frame around the box.

bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats

Box that is used to position the legend in conjunction with loc.

bbox_transform : None or :class:`matplotlib.transforms.Transform`

The transform for the bounding box (bbox_to_anchor).

**kwargs :

All other parameters are passed on to .OffsetBox .

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/offsetbox.py#956
type: <class 'function'>
Commit: