mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase#
- class mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase(bbox_to_anchor, offsetbox, loc, borderpad=0.5, bbox_transform=None)[source]#
Bases:
AnchoredOffsetbox- Parameters:
- locstr
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
Legendfor details.- padfloat, default: 0.4
Padding around the child as fraction of the fontsize.
- borderpadfloat or (float, float), default: 0.5
Padding between the offsetbox frame and the bbox_to_anchor. If a float, the same padding is used for both x and y. If a tuple of two floats, it specifies the (x, y) padding.
Added in version 3.11: The borderpad parameter now accepts a tuple of (x, y) paddings.
- child
OffsetBox The box that will be anchored.
- prop
FontProperties This is only used as a reference for paddings. If not given,
rcParams["legend.fontsize"](default:'medium') is used.- frameonbool
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_transformNone or
matplotlib.transforms.Transform The transform for the bounding box (bbox_to_anchor).
- **kwargs
All other parameters are passed on to
OffsetBox.
Notes
See
Legendfor a detailed description of the anchoring mechanism.- draw(renderer)[source]#
Update the location of children if necessary and draw them to the given renderer.
- set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, bbox_to_anchor=<UNSET>, child=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, mouseover=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, zorder=<UNSET>)[source]#
Set multiple properties at once.
a.set(a=A, b=B, c=C)
is equivalent to
a.set_a(A) a.set_b(B) a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2)is equivalent toset(linewidth=2), but it is an error to pass both simultaneously.The order of the individual setter calls matches the order of parameters in
set(). However, most properties do not depend on each other so that order is rarely relevant.Supported properties are
Property
Description
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
float or None
bool
unknown
unknown
BboxBaseor Nonebool
Patch or (Path, Transform) or None
str
float
bool
object
bool
(float, float) or callable
list of
AbstractPathEffectNone or bool or float or callable
bool
(scale: float, length: float, randomness: float)
bool or None
str
bool
float
float