| [ Web Proxy ] |
| Viewing: https://matplotlib.org/devdocs/api/_as_gen/../_as_gen/matplotlib.patches.FancyBboxPatch.html | [Back] [Original] |
Bases: Patch
A fancy box around a rectangle with lower left at xy = (x, y) with specified width and height.
FancyBboxPatch is similar to Rectangle, but it draws a fancy box
around the rectangle. The transformation of the rectangle box to the
fancy box is delegated to the style classes defined in BoxStyle.
The lower left corner of the box.
The width of the box.
The height of the box.
BoxStyleThe style of the fancy box. This can either be a BoxStyle
instance or a string of the style name and optionally comma
separated attributes (e.g. "Round, pad=0.2"). This string is
passed to BoxStyle to construct a BoxStyle object. See
there for a full documentation.
The following box styles are available:
Class |
Name |
Parameters |
|---|---|---|
Square |
|
pad=0.3 |
Circle |
|
pad=0.3 |
Ellipse |
|
pad=0.3 |
RArrow |
|
pad=0.3, head_width=1.5, head_angle=90 |
LArrow |
|
pad=0.3, head_width=1.5, head_angle=90 |
DArrow |
|
pad=0.3, head_width=1.5, head_angle=90 |
Round |
|
pad=0.3, rounding_size=None |
Round4 |
|
pad=0.3, rounding_size=None |
Sawtooth |
|
pad=0.3, tooth_size=None |
Roundtooth |
|
pad=0.3, tooth_size=None |
Scaling factor applied to the attributes of the box style (e.g. pad or rounding_size).
The height of the rectangle will be squeezed by this value before the mutation and the mutated box will be stretched by the inverse of it. For example, this allows different horizontal and vertical padding.
Patch propertiesProperty |
Description |
|---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
|
unknown |
|
bool |
|
|
bool or None |
|
|
|
|
bool |
|
Patch or (Path, Transform) or None |
|
color or None |
|
color or None |
|
color or None |
|
bool |
|
{'nonzero', 'evenodd'} |
|
str |
|
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} |
|
unknown |
|
color or 'edge' or None |
|
bool |
|
|
|
object |
|
float or None |
|
bool |
|
list of |
|
None or bool or float or callable |
|
bool |
|
(scale: float, length: float, randomness: float) |
|
bool or None |
|
str |
|
bool |
|
float |
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.
Supported properties are
Property
Description
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
float or None
bool
antialiasedoraabool or None
unknown
[ 'square' | 'circle' | 'ellipse' | 'rarrow' | 'larrow' | 'darrow' | 'round' | 'round4' | 'sawtooth' | 'roundtooth' ]
CapStyleor {'butt', 'projecting', 'round'}
BboxBaseor Nonebool
Patch or (Path, Transform) or None
color or None
color or None
color or None
bool
{'nonzero', 'evenodd'}
str
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
unknown
color or 'edge' or None
float
bool
JoinStyleor {'miter', 'round', 'bevel'}object
float or None
bool
float
float
list of
AbstractPathEffectNone or bool or float or callable
bool
(scale: float, length: float, randomness: float)
bool or None
str
bool
float
float
float
float
Set the bounds of the rectangle.
Call signatures:
set_bounds(left, bottom, width, height)
set_bounds((left, bottom, width, height))
The coordinates of the bottom left corner of the rectangle.
The width/height of the rectangle.
Set the box style, possibly with further attributes.
Attributes from the previous box style are not reused.
Without argument (or with boxstyle=None), the available box styles
are returned as a human-readable string.
BoxStyleThe style of the box: either a BoxStyle instance, or a string,
which is the style name and optionally comma separated attributes
(e.g. "Round,pad=0.2"). Such a string is used to construct a
BoxStyle object, as documented in that class.
The following box styles are available:
Class |
Name |
Parameters |
|---|---|---|
Square |
|
pad=0.3 |
Circle |
|
pad=0.3 |
Ellipse |
|
pad=0.3 |
RArrow |
|
pad=0.3, head_width=1.5, head_angle=90 |
LArrow |
|
pad=0.3, head_width=1.5, head_angle=90 |
DArrow |
|
pad=0.3, head_width=1.5, head_angle=90 |
Round |
|
pad=0.3, rounding_size=None |
Round4 |
|
pad=0.3, rounding_size=None |
Sawtooth |
|
pad=0.3, tooth_size=None |
Roundtooth |
|
pad=0.3, tooth_size=None |
Additional attributes for the box style. See the table above for supported parameters.
Examples
set_boxstyle("Round,pad=0.2")
set_boxstyle("round", pad=0.2)
matplotlib.patches.FancyBboxPatch#| Web Proxy Viewer | New URL | Original Page |