doc_content
stringlengths 1
386k
| doc_id
stringlengths 5
188
|
---|---|
tricontourf(*args, zdir='z', offset=None, data=None, **kwargs)[source]
Create a 3D filled contour plot. Note This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering. Parameters
X, Y, Zarray-like
Input data. See tricontourf for acceptable data shapes.
zdir{'x', 'y', 'z'}, default: 'z'
The direction to use.
offsetfloat, optional
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
dataindexable object, optional
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception). *args, **kwargs
Other arguments are forwarded to matplotlib.axes.Axes.tricontourf. Returns
matplotlib.tri.tricontour.TriContourSet
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axes3d.axes3d#mpl_toolkits.mplot3d.axes3d.Axes3D.tricontourf
|
tunit_cube(vals=None, M=None)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axes3d.axes3d#mpl_toolkits.mplot3d.axes3d.Axes3D.tunit_cube
|
tunit_edges(vals=None, M=None)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axes3d.axes3d#mpl_toolkits.mplot3d.axes3d.Axes3D.tunit_edges
|
unit_cube(vals=None)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axes3d.axes3d#mpl_toolkits.mplot3d.axes3d.Axes3D.unit_cube
|
update_datalim(xys, **kwargs)[source]
Extend the dataLim Bbox to include the given points. If no data is set currently, the Bbox will ignore its limits and set the bound to be the bounds of the xydata (xys). Otherwise, it will compute the bounds of the union of its current data and the data in xys. Parameters
xys2D array-like
The points to include in the data limits Bbox. This can be either a list of (x, y) tuples or a Nx2 array.
updatex, updateybool, default: True
Whether to update the x/y limits.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axes3d.axes3d#mpl_toolkits.mplot3d.axes3d.Axes3D.update_datalim
|
view_init(elev=None, azim=None, vertical_axis='z')[source]
Set the elevation and azimuth of the axes in degrees (not radians). This can be used to rotate the axes programmatically. Parameters
elevfloat, default: None
The elevation angle in the vertical plane in degrees. If None then the initial value as specified in the Axes3D constructor is used.
azimfloat, default: None
The azimuth angle in the horizontal plane in degrees. If None then the initial value as specified in the Axes3D constructor is used.
vertical_axis{"z", "x", "y"}, default: "z"
The axis to align vertically. azim rotates about this axis.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axes3d.axes3d#mpl_toolkits.mplot3d.axes3d.Axes3D.view_init
|
voxels([x, y, z, ]/, filled, facecolors=None, edgecolors=None, **kwargs)[source]
Plot a set of filled voxels All voxels are plotted as 1x1x1 cubes on the axis, with filled[0, 0, 0] placed with its lower corner at the origin. Occluded faces are not plotted. Parameters
filled3D np.array of bool
A 3D array of values, with truthy values indicating which voxels to fill
x, y, z3D np.array, optional
The coordinates of the corners of the voxels. This should broadcast to a shape one larger in every dimension than the shape of filled. These can be used to plot non-cubic voxels. If not specified, defaults to increasing integers along each axis, like those returned by indices(). As indicated by the / in the function signature, these arguments can only be passed positionally.
facecolors, edgecolorsarray-like, optional
The color to draw the faces and edges of the voxels. Can only be passed as keyword arguments. These parameters can be: A single color value, to color all voxels the same color. This can be either a string, or a 1D rgb/rgba array
None, the default, to use a single color for the faces, and the style default for the edges. A 3D ndarray of color names, with each item the color for the corresponding voxel. The size must match the voxels. A 4D ndarray of rgb/rgba data, with the components along the last axis.
shadebool, default: True
Whether to shade the facecolors. Shading is always disabled when cmap is specified.
lightsourceLightSource
The lightsource to use when shade is True. **kwargs
Additional keyword arguments to pass onto Poly3DCollection. Returns
facesdict
A dictionary indexed by coordinate, where faces[i, j, k] is a Poly3DCollection of the faces drawn for the voxel filled[i, j, k]. If no faces were drawn for a given voxel, either because it was not asked to be drawn, or it is fully occluded, then (i, j, k) not in faces. Examples (Source code, png, pdf) (Source code, png, pdf) (Source code, png, pdf) (Source code, png, pdf)
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axes3d.axes3d#mpl_toolkits.mplot3d.axes3d.Axes3D.voxels
|
zaxis_date(tz=None)[source]
Set up axis ticks and labels to treat data along the zaxis as dates. Parameters
tzstr or datetime.tzinfo, default: rcParams["timezone"] (default: 'UTC')
The timezone used to create date labels. Notes This function is merely provided for completeness, but 3D axes do not support dates for ticks, and so this may not work as expected.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axes3d.axes3d#mpl_toolkits.mplot3d.axes3d.Axes3D.zaxis_date
|
zaxis_inverted()[source]
Returns True if the z-axis is inverted.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axes3d.axes3d#mpl_toolkits.mplot3d.axes3d.Axes3D.zaxis_inverted
|
mpl_toolkits.mplot3d.axis3d.Axis classmpl_toolkits.mplot3d.axis3d.Axis(adir, v_intervalx, d_intervalx, axes, *args, rotate_label=None, **kwargs)[source]
Bases: matplotlib.axis.XAxis An Axis class for the 3D plots. Parameters
axesmatplotlib.axes.Axes
The Axes to which the created Axis belongs.
pickradiusfloat
The acceptance radius for containment tests. See also Axis.contains. propertyd_interval
draw(renderer)[source]
Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters
rendererRendererBase subclass.
Notes This method is overridden in the Artist subclasses.
draw_pane(renderer)[source]
get_major_ticks(numticks=None)[source]
Return the list of major Ticks.
get_minor_ticks(numticks=None)[source]
Return the list of minor Ticks.
get_rotate_label(text)[source]
get_tightbbox(renderer, *, for_layout_only=False)[source]
Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText. If for_layout_only is True, then the width of the label (if this is an x-axis) or the height of the label (if this is a y-axis) is collapsed to near zero. This allows tight/constrained_layout to ignore too-long labels when doing their layout.
init3d()[source]
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, data_interval=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, inverted=<UNSET>, label=<UNSET>, label_coords=<UNSET>, label_position=<UNSET>, label_text=<UNSET>, major_formatter=<UNSET>, major_locator=<UNSET>, minor_formatter=<UNSET>, minor_locator=<UNSET>, pane_color=<UNSET>, pane_pos=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, remove_overlapping_locs=<UNSET>, rotate_label=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, tick_params=<UNSET>, ticklabels=<UNSET>, ticks=<UNSET>, ticks_position=<UNSET>, transform=<UNSET>, units=<UNSET>, url=<UNSET>, view_interval=<UNSET>, visible=<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
data_interval unknown
figure Figure
gid str
in_layout bool
inverted unknown
label object
label_coords unknown
label_position {'top', 'bottom'}
label_text str
major_formatter Formatter, str, or function
major_locator Locator
minor_formatter Formatter, str, or function
minor_locator Locator
pane_color unknown
pane_pos unknown
path_effects AbstractPathEffect
picker None or bool or float or callable
pickradius float
rasterized bool
remove_overlapping_locs unknown
rotate_label unknown
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
tick_params unknown
ticklabels sequence of str or of Texts
ticks list of floats
ticks_position {'top', 'bottom', 'both', 'default', 'none'}
transform Transform
units units tag
url str
view_interval unknown
visible bool
zorder float
set_pane_color(color)[source]
Set pane color to a RGBA tuple.
set_pane_pos(xys)[source]
set_rotate_label(val)[source]
Whether to rotate the axis label: True, False or None. If set to None the label will be rotated if longer than 4 chars.
propertyv_interval
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis
|
draw(renderer)[source]
Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters
rendererRendererBase subclass.
Notes This method is overridden in the Artist subclasses.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.draw
|
draw_pane(renderer)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.draw_pane
|
get_major_ticks(numticks=None)[source]
Return the list of major Ticks.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.get_major_ticks
|
get_minor_ticks(numticks=None)[source]
Return the list of minor Ticks.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.get_minor_ticks
|
get_rotate_label(text)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.get_rotate_label
|
get_tightbbox(renderer, *, for_layout_only=False)[source]
Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText. If for_layout_only is True, then the width of the label (if this is an x-axis) or the height of the label (if this is a y-axis) is collapsed to near zero. This allows tight/constrained_layout to ignore too-long labels when doing their layout.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.get_tightbbox
|
init3d()[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.init3d
|
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, data_interval=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, inverted=<UNSET>, label=<UNSET>, label_coords=<UNSET>, label_position=<UNSET>, label_text=<UNSET>, major_formatter=<UNSET>, major_locator=<UNSET>, minor_formatter=<UNSET>, minor_locator=<UNSET>, pane_color=<UNSET>, pane_pos=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, remove_overlapping_locs=<UNSET>, rotate_label=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, tick_params=<UNSET>, ticklabels=<UNSET>, ticks=<UNSET>, ticks_position=<UNSET>, transform=<UNSET>, units=<UNSET>, url=<UNSET>, view_interval=<UNSET>, visible=<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
data_interval unknown
figure Figure
gid str
in_layout bool
inverted unknown
label object
label_coords unknown
label_position {'top', 'bottom'}
label_text str
major_formatter Formatter, str, or function
major_locator Locator
minor_formatter Formatter, str, or function
minor_locator Locator
pane_color unknown
pane_pos unknown
path_effects AbstractPathEffect
picker None or bool or float or callable
pickradius float
rasterized bool
remove_overlapping_locs unknown
rotate_label unknown
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
tick_params unknown
ticklabels sequence of str or of Texts
ticks list of floats
ticks_position {'top', 'bottom', 'both', 'default', 'none'}
transform Transform
units units tag
url str
view_interval unknown
visible bool
zorder float
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.set
|
set_pane_color(color)[source]
Set pane color to a RGBA tuple.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.set_pane_color
|
set_pane_pos(xys)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.set_pane_pos
|
set_rotate_label(val)[source]
Whether to rotate the axis label: True, False or None. If set to None the label will be rotated if longer than 4 chars.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis.set_rotate_label
|
mpl_toolkits.mplot3d.proj3d.inv_transform mpl_toolkits.mplot3d.proj3d.inv_transform(xs, ys, zs, M)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.proj3d.inv_transform
|
mpl_toolkits.mplot3d.proj3d.persp_transformation mpl_toolkits.mplot3d.proj3d.persp_transformation(zfront, zback)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.proj3d.persp_transformation
|
mpl_toolkits.mplot3d.proj3d.proj_points mpl_toolkits.mplot3d.proj3d.proj_points(points, M)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.proj3d.proj_points
|
mpl_toolkits.mplot3d.proj3d.proj_trans_points mpl_toolkits.mplot3d.proj3d.proj_trans_points(points, M)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.proj3d.proj_trans_points
|
mpl_toolkits.mplot3d.proj3d.proj_transform mpl_toolkits.mplot3d.proj3d.proj_transform(xs, ys, zs, M)[source]
Transform the points by the projection matrix
|
matplotlib._as_gen.mpl_toolkits.mplot3d.proj3d.proj_transform
|
mpl_toolkits.mplot3d.proj3d.proj_transform_clip mpl_toolkits.mplot3d.proj3d.proj_transform_clip(xs, ys, zs, M)[source]
Transform the points by the projection matrix and return the clipping result returns txs, tys, tzs, tis
|
matplotlib._as_gen.mpl_toolkits.mplot3d.proj3d.proj_transform_clip
|
mpl_toolkits.mplot3d.proj3d.rot_x mpl_toolkits.mplot3d.proj3d.rot_x(V, alpha)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.proj3d.rot_x
|
mpl_toolkits.mplot3d.proj3d.transform mpl_toolkits.mplot3d.proj3d.transform(xs, ys, zs, M)[source]
Transform the points by the projection matrix
|
matplotlib._as_gen.mpl_toolkits.mplot3d.proj3d.transform
|
mpl_toolkits.mplot3d.proj3d.view_transformation mpl_toolkits.mplot3d.proj3d.view_transformation(E, R, V)[source]
|
matplotlib._as_gen.mpl_toolkits.mplot3d.proj3d.view_transformation
|
mpl_toolkits.mplot3d.proj3d.world_transformation mpl_toolkits.mplot3d.proj3d.world_transformation(xmin, xmax, ymin, ymax, zmin, zmax, pb_aspect=None)[source]
Produce a matrix that scales homogeneous coords in the specified ranges to [0, 1], or [0, pb_aspect[i]] if the plotbox aspect ratio is specified.
|
matplotlib._as_gen.mpl_toolkits.mplot3d.proj3d.world_transformation
|
matplotlib.offsetbox Container classes for Artists. OffsetBox
The base of all container artists defined in this module.
AnchoredOffsetbox, AnchoredText
Anchor and align an arbitrary Artist or a text relative to the parent axes or a specific anchor point. DrawingArea
A container with fixed width and height. Children have a fixed position inside the container and may be clipped.
HPacker, VPacker
Containers for layouting their children vertically or horizontally. PaddedBox
A container to add a padding around an Artist. TextArea
Contains a single Text instance. 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
classmatplotlib.offsetbox.AnchoredText(s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs)[source]
Bases: matplotlib.offsetbox.AnchoredOffsetbox AnchoredOffsetbox with Text. Parameters
sstr
Text.
locstr
Location code. See AnchoredOffsetbox.
padfloat, default: 0.4
Padding around the text as fraction of the fontsize.
borderpadfloat, default: 0.5
Spacing between the offsetbox frame and the bbox_to_anchor.
propdict, optional
Dictionary of keyword parameters to be passed to the Text instance contained inside AnchoredText. **kwargs
All other parameters are passed to AnchoredOffsetbox. 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
classmatplotlib.offsetbox.AnnotationBbox(offsetbox, xy, xybox=None, xycoords='data', boxcoords=None, frameon=True, pad=0.4, annotation_clip=None, box_alignment=(0.5, 0.5), bboxprops=None, arrowprops=None, fontsize=None, **kwargs)[source]
Bases: matplotlib.artist.Artist, matplotlib.text._AnnotationBase Container for an OffsetBox referring to a specific position xy. Optionally an arrow pointing from the offsetbox to xy can be drawn. This is like Annotation, but with OffsetBox instead of Text. Parameters
offsetboxOffsetBox
xy(float, float)
The point (x, y) to annotate. The coordinate system is determined by xycoords.
xybox(float, float), default: xy
The position (x, y) to place the text at. The coordinate system is determined by boxcoords.
xycoordsstr or Artist or Transform or callable or (float, float), default: 'data'
The coordinate system that xy is given in. See the parameter xycoords in Annotation for a detailed description.
boxcoordsstr or Artist or Transform or callable or (float, float), default: value of xycoords
The coordinate system that xybox is given in. See the parameter textcoords in Annotation for a detailed description.
frameonbool, default: True
Whether to draw a frame around the box.
padfloat, default: 0.4
Padding around the offsetbox.
box_alignment(float, float)
A tuple of two floats for a vertical and horizontal alignment of the offset box w.r.t. the boxcoords. The lower-left corner is (0, 0) and upper-right corner is (1, 1). **kwargs
Other parameters are identical to Annotation. propertyanncoords
contains(mouseevent)[source]
Test whether the artist contains the mouse event. 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.
draw(renderer)[source]
Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters
rendererRendererBase subclass.
Notes This method is overridden in the Artist subclasses.
get_children()[source]
Return a list of the child Artists of this Artist.
get_fontsize()[source]
Return the fontsize in points.
get_tightbbox(renderer)[source]
Like Artist.get_window_extent, but includes any clipping. Parameters
rendererRendererBase subclass
renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer()) Returns
Bbox
The enclosing bounding box (in figure pixel coordinates).
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>, annotation_clip=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, fontsize=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<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
annotation_clip bool or None
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure unknown
fontsize unknown
gid str
in_layout bool
label object
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
zorder float
set_figure(fig)[source]
Set the Figure instance the artist belongs to. Parameters
figFigure
set_fontsize(s=None)[source]
Set the fontsize in points. If s is not given, reset to rcParams["legend.fontsize"] (default: 'medium').
update_positions(renderer)[source]
Update the pixel positions of the annotated point and the text.
propertyxyann
zorder=3
classmatplotlib.offsetbox.AuxTransformBox(aux_transform)[source]
Bases: matplotlib.offsetbox.OffsetBox Offset Box with the aux_transform. Its children will be transformed with the aux_transform first then will be offsetted. The absolute coordinate of the aux_transform is meaning as it will be automatically adjust so that the left-lower corner of the bounding box of children will be set to (0, 0) before the offset transform. It is similar to drawing area, except that the extent of the box is not predetermined but calculated from the window extent of its children. Furthermore, the extent of the children will be calculated in the transformed coordinate. add_artist(a)[source]
Add an Artist to the container box.
draw(renderer)[source]
Update the location of children if necessary and draw them to the given renderer.
get_extent(renderer)[source]
Return a tuple width, height, xdescent, ydescent of the box.
get_offset()[source]
Return offset of the container.
get_transform()[source]
Return the Transform applied to the children
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)
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 unknown
url str
visible bool
width float
zorder float
set_offset(xy)[source]
Set the offset of the container. Parameters
xy(float, float)
The (x, y) coordinates of the offset in display units.
set_transform(t)[source]
set_transform is ignored.
classmatplotlib.offsetbox.DraggableAnnotation(annotation, use_blit=False)[source]
Bases: matplotlib.offsetbox.DraggableBase save_offset()[source]
update_offset(dx, dy)[source]
classmatplotlib.offsetbox.DraggableBase(ref_artist, use_blit=False)[source]
Bases: object Helper base class for a draggable artist (legend, offsetbox). Derived classes must override the following methods: def save_offset(self):
'''
Called when the object is picked for dragging; should save the
reference position of the artist.
'''
def update_offset(self, dx, dy):
'''
Called during the dragging; (*dx*, *dy*) is the pixel offset from
the point where the mouse drag started.
'''
Optionally, you may override the following method: def finalize_offset(self):
'''Called when the mouse is released.'''
In the current implementation of DraggableLegend and DraggableAnnotation, update_offset places the artists in display coordinates, and finalize_offset recalculates their position in axes coordinate and set a relevant attribute. disconnect()[source]
Disconnect the callbacks.
finalize_offset()[source]
on_motion(evt)[source]
on_pick(evt)[source]
on_release(event)[source]
save_offset()[source]
update_offset(dx, dy)[source]
classmatplotlib.offsetbox.DraggableOffsetBox(ref_artist, offsetbox, use_blit=False)[source]
Bases: matplotlib.offsetbox.DraggableBase get_loc_in_canvas()[source]
save_offset()[source]
update_offset(dx, dy)[source]
classmatplotlib.offsetbox.DrawingArea(width, height, xdescent=0.0, ydescent=0.0, clip=False)[source]
Bases: matplotlib.offsetbox.OffsetBox The DrawingArea can contain any Artist as a child. The DrawingArea has a fixed width and height. The position of children relative to the parent is fixed. The children can be clipped at the boundaries of the parent. Parameters
width, heightfloat
Width and height of the container box.
xdescent, ydescentfloat
Descent of the box in x- and y-direction.
clipbool
Whether to clip the children to the box. add_artist(a)[source]
Add an Artist to the container box.
propertyclip_children
If the children of this DrawingArea should be clipped by DrawingArea bounding box.
draw(renderer)[source]
Update the location of children if necessary and draw them to the given renderer.
get_extent(renderer)[source]
Return width, height, xdescent, ydescent of box.
get_offset()[source]
Return offset of the container.
get_transform()[source]
Return the Transform applied to the children.
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)
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 unknown
url str
visible bool
width float
zorder float
set_offset(xy)[source]
Set the offset of the container. Parameters
xy(float, float)
The (x, y) coordinates of the offset in display units.
set_transform(t)[source]
set_transform is ignored.
classmatplotlib.offsetbox.HPacker(pad=None, sep=None, width=None, height=None, align='baseline', mode='fixed', children=None)[source]
Bases: matplotlib.offsetbox.PackerBase HPacker packs its children horizontally, automatically adjusting their relative positions at draw time. Parameters
padfloat, optional
The boundary padding in points.
sepfloat, optional
The spacing between items in points.
width, heightfloat, optional
Width and height of the container box in pixels, calculated if None.
align{'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'
Alignment of boxes.
mode{'fixed', 'expand', 'equal'}, default: 'fixed'
The packing mode. 'fixed' packs the given Artists tight with sep spacing. 'expand' uses the maximal available space to distribute the artists with equal spacing in between. 'equal': Each artist an equal fraction of the available space and is left-aligned (or top-aligned) therein.
childrenlist of Artist
The artists to pack. Notes pad and sep are in points and will be scaled with the renderer dpi, while width and height are in pixels. 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
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
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
classmatplotlib.offsetbox.OffsetImage(arr, zoom=1, cmap=None, norm=None, interpolation=None, origin=None, filternorm=True, filterrad=4.0, resample=False, dpi_cor=True, **kwargs)[source]
Bases: matplotlib.offsetbox.OffsetBox 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_data()[source]
get_extent(renderer)[source]
Return a tuple width, height, xdescent, ydescent of the box.
get_offset()[source]
Return offset of the container.
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.
get_zoom()[source]
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, data=<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>, zoom=<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
data unknown
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
zoom unknown
zorder float
set_data(arr)[source]
set_zoom(zoom)[source]
classmatplotlib.offsetbox.PackerBase(pad=None, sep=None, width=None, height=None, align='baseline', mode='fixed', children=None)[source]
Bases: matplotlib.offsetbox.OffsetBox Parameters
padfloat, optional
The boundary padding in points.
sepfloat, optional
The spacing between items in points.
width, heightfloat, optional
Width and height of the container box in pixels, calculated if None.
align{'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'
Alignment of boxes.
mode{'fixed', 'expand', 'equal'}, default: 'fixed'
The packing mode. 'fixed' packs the given Artists tight with sep spacing. 'expand' uses the maximal available space to distribute the artists with equal spacing in between. 'equal': Each artist an equal fraction of the available space and is left-aligned (or top-aligned) therein.
childrenlist of Artist
The artists to pack. Notes pad and sep are in points and will be scaled with the renderer dpi, while width and height are in pixels. 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
classmatplotlib.offsetbox.PaddedBox(child, pad=None, draw_frame=False, patch_attrs=None)[source]
Bases: matplotlib.offsetbox.OffsetBox A container to add a padding around an Artist. The PaddedBox contains a FancyBboxPatch that is used to visualize it when rendering. Parameters
childArtist
The contained Artist.
padfloat
The padding in points. This will be scaled with the renderer dpi. In contrast width and height are in pixels and thus not scaled.
draw_framebool
Whether to draw the contained FancyBboxPatch.
patch_attrsdict or None
Additional parameters passed to the contained FancyBboxPatch. draw(renderer)[source]
Update the location of children if necessary and draw them to the given renderer.
draw_frame(renderer)[source]
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
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
update_frame(bbox, fontsize=None)[source]
classmatplotlib.offsetbox.TextArea(s, textprops=None, multilinebaseline=False, minimumdescent=<deprecated parameter>)[source]
Bases: matplotlib.offsetbox.OffsetBox The TextArea is a container artist for a single Text instance. The text is placed at (0, 0) with baseline+left alignment, by default. The width and height of the TextArea instance is the width and height of its child text. Parameters
sstr
The text to be displayed.
textpropsdict, default: {}
Dictionary of keyword parameters to be passed to the Text instance in the TextArea.
multilinebaselinebool, default: False
Whether the baseline for multiline text is adjusted so that it is (approximately) center-aligned with single-line text.
minimumdescentbool, default: True
If True, the box has a minimum descent of "p". This is now effectively always True. draw(renderer)[source]
Update the location of children if necessary and draw them to the given renderer.
get_extent(renderer)[source]
Return a tuple width, height, xdescent, ydescent of the box.
get_minimumdescent()[source]
[Deprecated] Get minimumdescent. Notes Deprecated since version 3.4.
get_multilinebaseline()[source]
Get multilinebaseline.
get_offset()[source]
Return offset of the container.
get_text()[source]
Return the string representation of this area's text.
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>, minimumdescent=<UNSET>, multilinebaseline=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, text=<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
minimumdescent unknown
multilinebaseline unknown
offset (float, float)
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
text unknown
transform unknown
url str
visible bool
width float
zorder float
set_minimumdescent(t)[source]
[Deprecated] Set minimumdescent. If True, extent of the single line text is adjusted so that its descent is at least the one of the glyph "p". Notes Deprecated since version 3.4.
set_multilinebaseline(t)[source]
Set multilinebaseline. If True, the baseline for multiline text is adjusted so that it is (approximately) center-aligned with single-line text. This is used e.g. by the legend implementation so that single-line labels are baseline-aligned, but multiline labels are "center"-aligned with them.
set_offset(xy)[source]
Set the offset of the container. Parameters
xy(float, float)
The (x, y) coordinates of the offset in display units.
set_text(s)[source]
Set the text of this area as a string.
set_transform(t)[source]
set_transform is ignored.
classmatplotlib.offsetbox.VPacker(pad=None, sep=None, width=None, height=None, align='baseline', mode='fixed', children=None)[source]
Bases: matplotlib.offsetbox.PackerBase VPacker packs its children vertically, automatically adjusting their relative positions at draw time. Parameters
padfloat, optional
The boundary padding in points.
sepfloat, optional
The spacing between items in points.
width, heightfloat, optional
Width and height of the container box in pixels, calculated if None.
align{'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'
Alignment of boxes.
mode{'fixed', 'expand', 'equal'}, default: 'fixed'
The packing mode. 'fixed' packs the given Artists tight with sep spacing. 'expand' uses the maximal available space to distribute the artists with equal spacing in between. 'equal': Each artist an equal fraction of the available space and is left-aligned (or top-aligned) therein.
childrenlist of Artist
The artists to pack. Notes pad and sep are in points and will be scaled with the renderer dpi, while width and height are in pixels. 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
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
matplotlib.offsetbox.bbox_artist(*args, **kwargs)[source]
|
matplotlib.offsetbox_api
|
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
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox
|
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}
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.codes
|
draw(renderer)[source]
Update the location of children if necessary and draw them to the given renderer.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.draw
|
get_bbox_to_anchor()[source]
Return the bbox that the box is anchored to.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.get_bbox_to_anchor
|
get_child()[source]
Return the child.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.get_child
|
get_children()[source]
Return the list of children.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.get_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.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.get_extent
|
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.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.get_window_extent
|
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
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set
|
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.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor
|
set_child(child)[source]
Set the child to be anchored.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_child
|
update_frame(bbox, fontsize=None)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.update_frame
|
zorder=5
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.zorder
|
classmatplotlib.offsetbox.AnchoredText(s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs)[source]
Bases: matplotlib.offsetbox.AnchoredOffsetbox AnchoredOffsetbox with Text. Parameters
sstr
Text.
locstr
Location code. See AnchoredOffsetbox.
padfloat, default: 0.4
Padding around the text as fraction of the fontsize.
borderpadfloat, default: 0.5
Spacing between the offsetbox frame and the bbox_to_anchor.
propdict, optional
Dictionary of keyword parameters to be passed to the Text instance contained inside AnchoredText. **kwargs
All other parameters are passed to AnchoredOffsetbox. 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
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredText
|
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
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnchoredText.set
|
classmatplotlib.offsetbox.AnnotationBbox(offsetbox, xy, xybox=None, xycoords='data', boxcoords=None, frameon=True, pad=0.4, annotation_clip=None, box_alignment=(0.5, 0.5), bboxprops=None, arrowprops=None, fontsize=None, **kwargs)[source]
Bases: matplotlib.artist.Artist, matplotlib.text._AnnotationBase Container for an OffsetBox referring to a specific position xy. Optionally an arrow pointing from the offsetbox to xy can be drawn. This is like Annotation, but with OffsetBox instead of Text. Parameters
offsetboxOffsetBox
xy(float, float)
The point (x, y) to annotate. The coordinate system is determined by xycoords.
xybox(float, float), default: xy
The position (x, y) to place the text at. The coordinate system is determined by boxcoords.
xycoordsstr or Artist or Transform or callable or (float, float), default: 'data'
The coordinate system that xy is given in. See the parameter xycoords in Annotation for a detailed description.
boxcoordsstr or Artist or Transform or callable or (float, float), default: value of xycoords
The coordinate system that xybox is given in. See the parameter textcoords in Annotation for a detailed description.
frameonbool, default: True
Whether to draw a frame around the box.
padfloat, default: 0.4
Padding around the offsetbox.
box_alignment(float, float)
A tuple of two floats for a vertical and horizontal alignment of the offset box w.r.t. the boxcoords. The lower-left corner is (0, 0) and upper-right corner is (1, 1). **kwargs
Other parameters are identical to Annotation. propertyanncoords
contains(mouseevent)[source]
Test whether the artist contains the mouse event. 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.
draw(renderer)[source]
Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters
rendererRendererBase subclass.
Notes This method is overridden in the Artist subclasses.
get_children()[source]
Return a list of the child Artists of this Artist.
get_fontsize()[source]
Return the fontsize in points.
get_tightbbox(renderer)[source]
Like Artist.get_window_extent, but includes any clipping. Parameters
rendererRendererBase subclass
renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer()) Returns
Bbox
The enclosing bounding box (in figure pixel coordinates).
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>, annotation_clip=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, fontsize=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<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
annotation_clip bool or None
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure unknown
fontsize unknown
gid str
in_layout bool
label object
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
zorder float
set_figure(fig)[source]
Set the Figure instance the artist belongs to. Parameters
figFigure
set_fontsize(s=None)[source]
Set the fontsize in points. If s is not given, reset to rcParams["legend.fontsize"] (default: 'medium').
update_positions(renderer)[source]
Update the pixel positions of the annotated point and the text.
propertyxyann
zorder=3
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox
|
contains(mouseevent)[source]
Test whether the artist contains the mouse event. 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.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.contains
|
draw(renderer)[source]
Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters
rendererRendererBase subclass.
Notes This method is overridden in the Artist subclasses.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.draw
|
get_children()[source]
Return a list of the child Artists of this Artist.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.get_children
|
get_fontsize()[source]
Return the fontsize in points.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.get_fontsize
|
get_tightbbox(renderer)[source]
Like Artist.get_window_extent, but includes any clipping. Parameters
rendererRendererBase subclass
renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer()) Returns
Bbox
The enclosing bounding box (in figure pixel coordinates).
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.get_tightbbox
|
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.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.get_window_extent
|
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, annotation_clip=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, fontsize=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<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
annotation_clip bool or None
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure unknown
fontsize unknown
gid str
in_layout bool
label object
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
zorder float
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.set
|
set_figure(fig)[source]
Set the Figure instance the artist belongs to. Parameters
figFigure
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.set_figure
|
set_fontsize(s=None)[source]
Set the fontsize in points. If s is not given, reset to rcParams["legend.fontsize"] (default: 'medium').
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.set_fontsize
|
update_positions(renderer)[source]
Update the pixel positions of the annotated point and the text.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.update_positions
|
zorder=3
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AnnotationBbox.zorder
|
classmatplotlib.offsetbox.AuxTransformBox(aux_transform)[source]
Bases: matplotlib.offsetbox.OffsetBox Offset Box with the aux_transform. Its children will be transformed with the aux_transform first then will be offsetted. The absolute coordinate of the aux_transform is meaning as it will be automatically adjust so that the left-lower corner of the bounding box of children will be set to (0, 0) before the offset transform. It is similar to drawing area, except that the extent of the box is not predetermined but calculated from the window extent of its children. Furthermore, the extent of the children will be calculated in the transformed coordinate. add_artist(a)[source]
Add an Artist to the container box.
draw(renderer)[source]
Update the location of children if necessary and draw them to the given renderer.
get_extent(renderer)[source]
Return a tuple width, height, xdescent, ydescent of the box.
get_offset()[source]
Return offset of the container.
get_transform()[source]
Return the Transform applied to the children
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)
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 unknown
url str
visible bool
width float
zorder float
set_offset(xy)[source]
Set the offset of the container. Parameters
xy(float, float)
The (x, y) coordinates of the offset in display units.
set_transform(t)[source]
set_transform is ignored.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AuxTransformBox
|
add_artist(a)[source]
Add an Artist to the container box.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AuxTransformBox.add_artist
|
draw(renderer)[source]
Update the location of children if necessary and draw them to the given renderer.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AuxTransformBox.draw
|
get_extent(renderer)[source]
Return a tuple width, height, xdescent, ydescent of the box.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AuxTransformBox.get_extent
|
get_offset()[source]
Return offset of the container.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AuxTransformBox.get_offset
|
get_transform()[source]
Return the Transform applied to the children
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AuxTransformBox.get_transform
|
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.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AuxTransformBox.get_window_extent
|
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)
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 unknown
url str
visible bool
width float
zorder float
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AuxTransformBox.set
|
set_offset(xy)[source]
Set the offset of the container. Parameters
xy(float, float)
The (x, y) coordinates of the offset in display units.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AuxTransformBox.set_offset
|
set_transform(t)[source]
set_transform is ignored.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.AuxTransformBox.set_transform
|
matplotlib.offsetbox.bbox_artist(*args, **kwargs)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.bbox_artist
|
classmatplotlib.offsetbox.DraggableAnnotation(annotation, use_blit=False)[source]
Bases: matplotlib.offsetbox.DraggableBase save_offset()[source]
update_offset(dx, dy)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableAnnotation
|
save_offset()[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableAnnotation.save_offset
|
update_offset(dx, dy)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableAnnotation.update_offset
|
classmatplotlib.offsetbox.DraggableBase(ref_artist, use_blit=False)[source]
Bases: object Helper base class for a draggable artist (legend, offsetbox). Derived classes must override the following methods: def save_offset(self):
'''
Called when the object is picked for dragging; should save the
reference position of the artist.
'''
def update_offset(self, dx, dy):
'''
Called during the dragging; (*dx*, *dy*) is the pixel offset from
the point where the mouse drag started.
'''
Optionally, you may override the following method: def finalize_offset(self):
'''Called when the mouse is released.'''
In the current implementation of DraggableLegend and DraggableAnnotation, update_offset places the artists in display coordinates, and finalize_offset recalculates their position in axes coordinate and set a relevant attribute. disconnect()[source]
Disconnect the callbacks.
finalize_offset()[source]
on_motion(evt)[source]
on_pick(evt)[source]
on_release(event)[source]
save_offset()[source]
update_offset(dx, dy)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableBase
|
disconnect()[source]
Disconnect the callbacks.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableBase.disconnect
|
finalize_offset()[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableBase.finalize_offset
|
on_motion(evt)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableBase.on_motion
|
on_pick(evt)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableBase.on_pick
|
on_release(event)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableBase.on_release
|
save_offset()[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableBase.save_offset
|
update_offset(dx, dy)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableBase.update_offset
|
classmatplotlib.offsetbox.DraggableOffsetBox(ref_artist, offsetbox, use_blit=False)[source]
Bases: matplotlib.offsetbox.DraggableBase get_loc_in_canvas()[source]
save_offset()[source]
update_offset(dx, dy)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableOffsetBox
|
get_loc_in_canvas()[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableOffsetBox.get_loc_in_canvas
|
save_offset()[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableOffsetBox.save_offset
|
update_offset(dx, dy)[source]
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DraggableOffsetBox.update_offset
|
classmatplotlib.offsetbox.DrawingArea(width, height, xdescent=0.0, ydescent=0.0, clip=False)[source]
Bases: matplotlib.offsetbox.OffsetBox The DrawingArea can contain any Artist as a child. The DrawingArea has a fixed width and height. The position of children relative to the parent is fixed. The children can be clipped at the boundaries of the parent. Parameters
width, heightfloat
Width and height of the container box.
xdescent, ydescentfloat
Descent of the box in x- and y-direction.
clipbool
Whether to clip the children to the box. add_artist(a)[source]
Add an Artist to the container box.
propertyclip_children
If the children of this DrawingArea should be clipped by DrawingArea bounding box.
draw(renderer)[source]
Update the location of children if necessary and draw them to the given renderer.
get_extent(renderer)[source]
Return width, height, xdescent, ydescent of box.
get_offset()[source]
Return offset of the container.
get_transform()[source]
Return the Transform applied to the children.
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)
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 unknown
url str
visible bool
width float
zorder float
set_offset(xy)[source]
Set the offset of the container. Parameters
xy(float, float)
The (x, y) coordinates of the offset in display units.
set_transform(t)[source]
set_transform is ignored.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DrawingArea
|
add_artist(a)[source]
Add an Artist to the container box.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DrawingArea.add_artist
|
draw(renderer)[source]
Update the location of children if necessary and draw them to the given renderer.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DrawingArea.draw
|
get_extent(renderer)[source]
Return width, height, xdescent, ydescent of box.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DrawingArea.get_extent
|
get_offset()[source]
Return offset of the container.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DrawingArea.get_offset
|
get_transform()[source]
Return the Transform applied to the children.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DrawingArea.get_transform
|
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.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DrawingArea.get_window_extent
|
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)
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 unknown
url str
visible bool
width float
zorder float
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DrawingArea.set
|
set_offset(xy)[source]
Set the offset of the container. Parameters
xy(float, float)
The (x, y) coordinates of the offset in display units.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DrawingArea.set_offset
|
set_transform(t)[source]
set_transform is ignored.
|
matplotlib.offsetbox_api#matplotlib.offsetbox.DrawingArea.set_transform
|
classmatplotlib.offsetbox.HPacker(pad=None, sep=None, width=None, height=None, align='baseline', mode='fixed', children=None)[source]
Bases: matplotlib.offsetbox.PackerBase HPacker packs its children horizontally, automatically adjusting their relative positions at draw time. Parameters
padfloat, optional
The boundary padding in points.
sepfloat, optional
The spacing between items in points.
width, heightfloat, optional
Width and height of the container box in pixels, calculated if None.
align{'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'
Alignment of boxes.
mode{'fixed', 'expand', 'equal'}, default: 'fixed'
The packing mode. 'fixed' packs the given Artists tight with sep spacing. 'expand' uses the maximal available space to distribute the artists with equal spacing in between. 'equal': Each artist an equal fraction of the available space and is left-aligned (or top-aligned) therein.
childrenlist of Artist
The artists to pack. Notes pad and sep are in points and will be scaled with the renderer dpi, while width and height are in pixels. 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
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
|
matplotlib.offsetbox_api#matplotlib.offsetbox.HPacker
|
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
|
matplotlib.offsetbox_api#matplotlib.offsetbox.HPacker.get_extent_offsets
|
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
|
matplotlib.offsetbox_api#matplotlib.offsetbox.HPacker.set
|
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
|
matplotlib.offsetbox_api#matplotlib.offsetbox.OffsetBox
|
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
|
matplotlib.offsetbox_api#matplotlib.offsetbox.OffsetBox.contains
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.