classmatplotlib.offsetbox.AnchoredOffsetbox(loc, pad=0.4, borderpad=0.5, child=None, prop=None, frameon=True, bbox_to_anchor=None, bbox_transform=None, **kwargs)[source]
 
Bases: matplotlib.offsetbox.OffsetBox An offset box placed according to location loc. AnchoredOffsetbox has a single child. When multiple children are needed, use an extra OffsetBox to enclose them. By default, the offset box is anchored against its parent axes. You may explicitly specify the bbox_to_anchor.  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 Legend for details.  
padfloat, default: 0.4


Padding around the child as fraction of the fontsize.  
borderpadfloat, default: 0.5


Padding between the offsetbox frame and the bbox_to_anchor.  
childOffsetBox


The box that will be anchored.  
propFontProperties


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_anchorBboxBase, 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 Legend for a detailed description of the anchoring mechanism.   codes={'center': 10, 'center left': 6, 'center right': 7, 'lower center': 8, 'lower left': 3, 'lower right': 4, 'right': 5, 'upper center': 9, 'upper left': 2, 'upper right': 1}

   draw(renderer)[source]
 
Update the location of children if necessary and draw them to the given renderer. 
   get_bbox_to_anchor()[source]
 
Return the bbox that the box is anchored to. 
   get_child()[source]
 
Return the child. 
   get_children()[source]
 
Return the list of children. 
   get_extent(renderer)[source]
 
Return the extent of the box as (width, height, x, y). This is the extent of the child plus the padding. 
   get_window_extent(renderer)[source]
 
Get the artist's bounding box in display space. The bounding box' width and height are nonnegative. Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly. 
   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>, 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. Supported properties are   
Property Description   
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array  
alpha scalar or None  
animated bool  
bbox_to_anchor unknown  
child unknown  
clip_box Bbox  
clip_on bool  
clip_path Patch or (Path, Transform) or None  
figure Figure  
gid str  
height float  
in_layout bool  
label object  
offset (float, float) or callable  
path_effects AbstractPathEffect  
picker None or bool or float or callable  
rasterized bool  
sketch_params (scale: float, length: float, randomness: float)  
snap bool or None  
transform Transform  
url str  
visible bool  
width float  
zorder float   
   set_bbox_to_anchor(bbox, transform=None)[source]
 
Set the bbox that the box is anchored to. bbox can be a Bbox instance, a list of [left, bottom, width, height], or a list of [left, bottom] where the width and height will be assumed to be zero. The bbox will be transformed to display coordinate by the given transform. 
   set_child(child)[source]
 
Set the child to be anchored. 
   update_frame(bbox, fontsize=None)[source]

   zorder=5