classmatplotlib.offsetbox.OffsetBox(*args, **kwargs)[source]
 
Bases: matplotlib.artist.Artist The OffsetBox is a simple container artist. The child artists are meant to be drawn at a relative position to its parent. Being an artist itself, all parameters are passed on to Artist.   propertyaxes
 
The Axes instance the artist resides in, or None. 
   contains(mouseevent)[source]
 
Delegate the mouse event contains-check to the children. As a container, the OffsetBox does not respond itself to mouseevents.  Parameters 
 
mouseeventmatplotlib.backend_bases.MouseEvent

  Returns 
 
containsbool


Whether any values are within the radius.  
detailsdict


An artist-specific dictionary of details of the event context, such as which points are contained in the pick radius. See the individual Artist subclasses for details.      See also  Artist.contains
  
   draw(renderer)[source]
 
Update the location of children if necessary and draw them to the given renderer. 
   get_children()[source]
 
Return a list of the child Artists. 
   get_extent(renderer)[source]
 
Return a tuple width, height, xdescent, ydescent of the box. 
   get_extent_offsets(renderer)[source]
 
Update offset of the children and return the extent of the box.  Parameters 
 
rendererRendererBase subclass

  Returns 
 width
height
xdescent
ydescent
list of (xoffset, yoffset) pairs
   
   get_offset(width, height, xdescent, ydescent, renderer)[source]
 
Return the offset as a tuple (x, y). The extent parameters have to be provided to handle the case where the offset is dynamically determined by a callable (see set_offset).  Parameters 
 width, height, xdescent, ydescent

Extent parameters.  
rendererRendererBase subclass

   
   get_visible_children()[source]
 
Return a list of the visible child Artists. 
   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>, 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  
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_figure(fig)[source]
 
Set the Figure for the OffsetBox and all its children.  Parameters 
 
figFigure

   
   set_height(height)[source]
 
Set the height of the box.  Parameters 
 
heightfloat

   
   set_offset(xy)[source]
 
Set the offset.  Parameters 
 
xy(float, float) or callable


The (x, y) coordinates of the offset in display units. These can either be given explicitly as a tuple (x, y), or by providing a function that converts the extent into the offset. This function must have the signature: def offset(width, height, xdescent, ydescent, renderer) -> (float, float)
     
   set_width(width)[source]
 
Set the width of the box.  Parameters 
 
widthfloat