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:
loc : str
The box location. Valid locations are
'upper left', 'upper center', 'upper right',
'center left', 'center', 'center right',
'lower left', 'lower center', 'lower right'.
For backward compatibility, numeric values are accepted as well.
See the parameter loc of Legend for details.
pad : float, default: 0.4
Padding around the child as fraction of the fontsize.
All child artists are first transformed with aux_transform, then
translated with an offset (the same for all children) so the bounding
box of the children matches the drawn box. (In other words, adding an
arbitrary translation to aux_transform has no effect as it will be
cancelled out by the later offsetting.)
AuxTransformBox is similar to DrawingArea, except that the extent of
the box is not predetermined but calculated from the window extent of its
children, and the extent of the children will be calculated in the
transformed coordinate.
Helper base class for a draggable artist (legend, offsetbox).
Derived classes must override the following methods:
defsave_offset(self):''' Called when the object is picked for dragging; should save the reference position of the artist. '''defupdate_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:
deffinalize_offset(self):'''Called when the mouse is released.'''
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.
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:
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:
s : str
The text to be displayed.
textprops : dict, default: {}
Dictionary of keyword parameters to be passed to the Text
instance in the TextArea.
multilinebaseline : bool, default: False
Whether the baseline for multiline text is adjusted so that it
is (approximately) center-aligned with single-line text.
draw(renderer)
Update the location of children if necessary and draw them
to the given renderer.
get_bbox(renderer)
Return the bbox of the offsetbox, ignoring parent offsets.
get_multilinebaseline()
Get multilinebaseline.
get_offset()
Return offset of the container.
get_text()
Return the string representation of this area's text.
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)
Set the offset of the container.
Parameters:
xy : (float, float)
The (x, y) coordinates of the offset in display units.
Padding between the offsetbox frame and the bbox_to_anchor.
If a float, the same padding is used for both x and y.
If a tuple of two floats, it specifies the (x, y) padding.
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.
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
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.
xycoords : single or two-tuple of str or Artist or Transform or callable, default: 'data'
The coordinate system that xy is given in. See the parameter
xycoords in Annotation for a detailed description.
boxcoords : single or two-tuple of str or Artist or Transform or callable, default: value of xycoords
The coordinate system that xybox is given in. See the parameter
textcoords in Annotation for a detailed description.
frameon : bool, default: True
By default, the text is surrounded by a white FancyBboxPatch
(accessible as the patch attribute of the AnnotationBbox).
If frameon is set to False, this patch is made invisible.
annotation_clip: bool or None, default: None
Whether to clip (i.e. not draw) the annotation when the annotation
point xy is outside the Axes area.
If True, the annotation will be clipped when xy is outside
the Axes.
If False, the annotation will always be drawn.
If None, the annotation will be clipped when xy is outside
the Axes and xycoords is 'data'.
pad : float, 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).
bboxprops : dict, optional
A dictionary of properties to set for the annotation bounding box,
for example boxstyle and alpha. See FancyBboxPatch for
details.
Translated to points and passed as mutation_scale into
FancyBboxPatch to scale attributes of the box style (e.g. pad
or rounding_size). The name is chosen in analogy to Text where
fontsize defines the mutation scale as well. If not given,
rcParams["legend.fontsize"] (default: 'medium') is used. See Text.set_fontsize for valid
values.
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)
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).
Update pixel positions for the annotated point, the text, and the arrow.
propertyxyann
zorder=3
<UNSET>
in_layout=<UNSET>
label=<UNSET>
mouseover=<UNSET>
offset=<UNSET>
path_effects=<UNSET>
picker=<UNSET>
rasterized=<UNSET>
sketch_params=<UNSET>
snap=<UNSET>
transform=<UNSET>
url=<UNSET>
visible=<UNSET>
width=<UNSET>
zorder=<UNSET>
)
Set multiple properties at once.
a.set(a=A,b=B,c=C)
is equivalent to
a.set_a(A)a.set_b(B)a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
<UNSET>
in_layout=<UNSET>
label=<UNSET>
mouseover=<UNSET>
offset=<UNSET>
path_effects=<UNSET>
picker=<UNSET>
rasterized=<UNSET>
sketch_params=<UNSET>
snap=<UNSET>
transform=<UNSET>
url=<UNSET>
visible=<UNSET>
width=<UNSET>
zorder=<UNSET>
)
Set multiple properties at once.
a.set(a=A,b=B,c=C)
is equivalent to
a.set_a(A)a.set_b(B)a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
Artist
sep
'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.
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
contains : bool
Whether any values are within the radius.
details : dict
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.
Renderer used to draw the figure (i.e. fig.canvas.get_renderer()).
<UNSET>
in_layout=<UNSET>
label=<UNSET>
mouseover=<UNSET>
offset=<UNSET>
path_effects=<UNSET>
picker=<UNSET>
rasterized=<UNSET>
sketch_params=<UNSET>
snap=<UNSET>
transform=<UNSET>
url=<UNSET>
visible=<UNSET>
width=<UNSET>
zorder=<UNSET>
)
Set multiple properties at once.
a.set(a=A,b=B,c=C)
is equivalent to
a.set_a(A)a.set_b(B)a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
Place the [0, 0] index of the array in the upper left or lower left
corner of the Axes. The convention 'upper' is typically used for
matrices and images.
filternorm : bool, default: True
A parameter for the antigrain image resize filter
(see the antigrain documentation).
If filternorm is set, the filter normalizes integer values and corrects
the rounding errors. It doesn't do anything with the source floating
point values, it corrects only integers according to the rule of 1.0
which means that any sum of pixel weights must be equal to 1.0. So,
the filter function must produce a graph of the proper shape.
filterrad : float > 0, default: 4
The filter radius for filters that have a radius parameter, i.e. when
interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
resample : bool, default: False
When True, use a full resampling method. When False, only resample when
the output image is larger than the input image.
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
FancyBboxPatch
patch_attrs : dict or None
Additional parameters passed to the contained FancyBboxPatch.
<UNSET>
in_layout=<UNSET>
label=<UNSET>
mouseover=<UNSET>
offset=<UNSET>
path_effects=<UNSET>
picker=<UNSET>
rasterized=<UNSET>
sketch_params=<UNSET>
snap=<UNSET>
transform=<UNSET>
url=<UNSET>
visible=<UNSET>
width=<UNSET>
zorder=<UNSET>
)
Set multiple properties at once.
a.set(a=A,b=B,c=C)
is equivalent to
a.set_a(A)a.set_b(B)a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
<UNSET>
in_layout=<UNSET>
label=<UNSET>
mouseover=<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>
)
Set multiple properties at once.
a.set(a=A,b=B,c=C)
is equivalent to
a.set_a(A)a.set_b(B)a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
Artist
sep
'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.
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
a
.
set_c
(
C
)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image