doc_content
stringlengths 1
386k
| doc_id
stringlengths 5
188
|
---|---|
transmute(path, mutation_size, linewidth)[source]
The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.
|
matplotlib._as_gen.matplotlib.patches.arrowstyle#matplotlib.patches.ArrowStyle.Wedge.transmute
|
matplotlib.patches.bbox_artist matplotlib.patches.bbox_artist(artist, renderer, props=None, fill=True)[source]
A debug function to draw a rectangle around the bounding box returned by an artist's Artist.get_window_extent to test whether the artist is returning the correct bbox. props is a dict of rectangle props with the additional property 'pad' that sets the padding around the bbox in points.
|
matplotlib._as_gen.matplotlib.patches.bbox_artist
|
matplotlib.patches.BoxStyle classmatplotlib.patches.BoxStyle(stylename, **kw)[source]
Bases: matplotlib.patches._Style BoxStyle is a container class which defines several boxstyle classes, which are used for FancyBboxPatch. A style object can be created as: BoxStyle.Round(pad=0.2)
or: BoxStyle("Round", pad=0.2)
or: BoxStyle("Round, pad=0.2")
The following boxstyle classes are defined.
Class Name Attrs
Square square pad=0.3
Circle circle pad=0.3
LArrow larrow pad=0.3
RArrow rarrow pad=0.3
DArrow darrow pad=0.3
Round round pad=0.3, rounding_size=None
Round4 round4 pad=0.3, rounding_size=None
Sawtooth sawtooth pad=0.3, tooth_size=None
Roundtooth roundtooth pad=0.3, tooth_size=None An instance of any boxstyle class is an callable object, whose call signature is: __call__(self, x0, y0, width, height, mutation_size)
and returns a Path instance. x0, y0, width and height specify the location and size of the box to be drawn. mutation_scale determines the overall size of the mutation (by which I mean the transformation of the rectangle to the fancy box). Return the instance of the subclass with the given style name. classCircle(pad=0.3)[source]
Bases: matplotlib.patches.BoxStyle._Base A circular box. Parameters
padfloat, default: 0.3
The amount of padding around the original box. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
classDArrow(pad=0.3)[source]
Bases: matplotlib.patches.BoxStyle._Base A box in the shape of a two-way arrow. Parameters
padfloat, default: 0.3
The amount of padding around the original box. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
classLArrow(pad=0.3)[source]
Bases: matplotlib.patches.BoxStyle._Base A box in the shape of a left-pointing arrow. Parameters
padfloat, default: 0.3
The amount of padding around the original box. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
classRArrow(pad=0.3)[source]
Bases: matplotlib.patches.BoxStyle.LArrow A box in the shape of a right-pointing arrow. Parameters
padfloat, default: 0.3
The amount of padding around the original box. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
classRound(pad=0.3, rounding_size=None)[source]
Bases: matplotlib.patches.BoxStyle._Base A box with round corners. Parameters
padfloat, default: 0.3
The amount of padding around the original box.
rounding_sizefloat, default: pad
Radius of the corners. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
classRound4(pad=0.3, rounding_size=None)[source]
Bases: matplotlib.patches.BoxStyle._Base A box with rounded edges. Parameters
padfloat, default: 0.3
The amount of padding around the original box.
rounding_sizefloat, default: pad/2
Rounding of edges. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
classRoundtooth(pad=0.3, tooth_size=None)[source]
Bases: matplotlib.patches.BoxStyle.Sawtooth A box with a rounded sawtooth outline. Parameters
padfloat, default: 0.3
The amount of padding around the original box.
tooth_sizefloat, default: pad/2
Size of the sawtooth. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
classSawtooth(pad=0.3, tooth_size=None)[source]
Bases: matplotlib.patches.BoxStyle._Base A box with a sawtooth outline. Parameters
padfloat, default: 0.3
The amount of padding around the original box.
tooth_sizefloat, default: pad/2
Size of the sawtooth. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
classSquare(pad=0.3)[source]
Bases: matplotlib.patches.BoxStyle._Base A square box. Parameters
padfloat, default: 0.3
The amount of padding around the original box. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
Examples using matplotlib.patches.BoxStyle
Reference for Matplotlib artists
|
matplotlib._as_gen.matplotlib.patches.boxstyle
|
classCircle(pad=0.3)[source]
Bases: matplotlib.patches.BoxStyle._Base A circular box. Parameters
padfloat, default: 0.3
The amount of padding around the original box. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Circle
|
__call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Circle.__call__
|
classDArrow(pad=0.3)[source]
Bases: matplotlib.patches.BoxStyle._Base A box in the shape of a two-way arrow. Parameters
padfloat, default: 0.3
The amount of padding around the original box. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.DArrow
|
__call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.DArrow.__call__
|
classLArrow(pad=0.3)[source]
Bases: matplotlib.patches.BoxStyle._Base A box in the shape of a left-pointing arrow. Parameters
padfloat, default: 0.3
The amount of padding around the original box. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.LArrow
|
__call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.LArrow.__call__
|
classRArrow(pad=0.3)[source]
Bases: matplotlib.patches.BoxStyle.LArrow A box in the shape of a right-pointing arrow. Parameters
padfloat, default: 0.3
The amount of padding around the original box. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.RArrow
|
__call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.RArrow.__call__
|
classRound(pad=0.3, rounding_size=None)[source]
Bases: matplotlib.patches.BoxStyle._Base A box with round corners. Parameters
padfloat, default: 0.3
The amount of padding around the original box.
rounding_sizefloat, default: pad
Radius of the corners. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Round
|
__call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Round.__call__
|
classRound4(pad=0.3, rounding_size=None)[source]
Bases: matplotlib.patches.BoxStyle._Base A box with rounded edges. Parameters
padfloat, default: 0.3
The amount of padding around the original box.
rounding_sizefloat, default: pad/2
Rounding of edges. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Round4
|
__call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Round4.__call__
|
classRoundtooth(pad=0.3, tooth_size=None)[source]
Bases: matplotlib.patches.BoxStyle.Sawtooth A box with a rounded sawtooth outline. Parameters
padfloat, default: 0.3
The amount of padding around the original box.
tooth_sizefloat, default: pad/2
Size of the sawtooth. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Roundtooth
|
__call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Roundtooth.__call__
|
classSawtooth(pad=0.3, tooth_size=None)[source]
Bases: matplotlib.patches.BoxStyle._Base A box with a sawtooth outline. Parameters
padfloat, default: 0.3
The amount of padding around the original box.
tooth_sizefloat, default: pad/2
Size of the sawtooth. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Sawtooth
|
__call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Sawtooth.__call__
|
classSquare(pad=0.3)[source]
Bases: matplotlib.patches.BoxStyle._Base A square box. Parameters
padfloat, default: 0.3
The amount of padding around the original box. __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Square
|
__call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]
Given the location and size of the box, return the path of the box around it. Parameters
x0, y0, width, heightfloat
Location and size of the box.
mutation_sizefloat
A reference scale for the mutation. Returns
Path
|
matplotlib._as_gen.matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle.Square.__call__
|
matplotlib.patches.Circle classmatplotlib.patches.Circle(xy, radius=5, **kwargs)[source]
Bases: matplotlib.patches.Ellipse A circle patch. Create a true circle at center xy = (x, y) with given radius. Unlike CirclePolygon which is a polygonal approximation, this uses Bezier splines and is much closer to a scale-free circle. Valid keyword arguments 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 unknown
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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 get_radius()[source]
Return the radius of the circle.
propertyradius
Return the radius of the circle.
set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, radius=<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
angle float
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
center (float, float)
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
height float
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
path_effects AbstractPathEffect
picker None or bool or float or callable
radius float
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_radius(radius)[source]
Set the radius of the circle. Parameters
radiusfloat
Examples using matplotlib.patches.Circle
Clipping images with patches
Axes box aspect
AnnotationBbox demo
Reference for Matplotlib artists
Dolphins
Circles, Wedges and Polygons
ggplot style sheet
Grayscale style sheet
Style sheets reference
Simple Anchored Artists
Anatomy of a figure
Looking Glass
Anchored Artists
Custom projection
Packed-bubble chart
Draw flat objects in 3D plot
Radar chart (aka spider or star chart)
Artist tutorial
Legend guide
Transformations Tutorial
Annotations
|
matplotlib._as_gen.matplotlib.patches.circle
|
get_radius()[source]
Return the radius of the circle.
|
matplotlib._as_gen.matplotlib.patches.circle#matplotlib.patches.Circle.get_radius
|
set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, radius=<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
angle float
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
center (float, float)
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
height float
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
path_effects AbstractPathEffect
picker None or bool or float or callable
radius float
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._as_gen.matplotlib.patches.circle#matplotlib.patches.Circle.set
|
set_radius(radius)[source]
Set the radius of the circle. Parameters
radiusfloat
|
matplotlib._as_gen.matplotlib.patches.circle#matplotlib.patches.Circle.set_radius
|
matplotlib.patches.CirclePolygon classmatplotlib.patches.CirclePolygon(xy, radius=5, resolution=20, **kwargs)[source]
Bases: matplotlib.patches.RegularPolygon A polygon-approximation of a circle patch. Create a circle at xy = (x, y) with given radius. This circle is approximated by a regular polygon with resolution sides. For a smoother circle drawn with splines, see Circle. Valid keyword arguments 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 unknown
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<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
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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._as_gen.matplotlib.patches.circlepolygon
|
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<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
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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._as_gen.matplotlib.patches.circlepolygon#matplotlib.patches.CirclePolygon.set
|
matplotlib.patches.ConnectionPatch classmatplotlib.patches.ConnectionPatch(xyA, xyB, coordsA, coordsB=None, axesA=None, axesB=None, arrowstyle='-', connectionstyle='arc3', patchA=None, patchB=None, shrinkA=0.0, shrinkB=0.0, mutation_scale=10.0, mutation_aspect=None, clip_on=False, dpi_cor=<deprecated parameter>, **kwargs)[source]
Bases: matplotlib.patches.FancyArrowPatch A patch that connects two points (possibly in different axes). Connect point xyA in coordsA with point xyB in coordsB. Valid keys are
Key Description
arrowstyle the arrow style
connectionstyle the connection style
relpos default is (0.5, 0.5)
patchA default is bounding box of the text
patchB default is None
shrinkA default is 2 points
shrinkB default is 2 points
mutation_scale default is text size (in points)
mutation_aspect default is 1.
? any key for matplotlib.patches.PathPatch coordsA and coordsB are strings that indicate the coordinates of xyA and xyB.
Property Description
'figure points' points from the lower left corner of the figure
'figure pixels' pixels from the lower left corner of the figure
'figure fraction' 0, 0 is lower left of figure and 1, 1 is upper right
'subfigure points' points from the lower left corner of the subfigure
'subfigure pixels' pixels from the lower left corner of the subfigure
'subfigure fraction' fraction of the subfigure, 0, 0 is lower left.
'axes points' points from lower left corner of axes
'axes pixels' pixels from lower left corner of axes
'axes fraction' 0, 0 is lower left of axes and 1, 1 is upper right
'data' use the coordinate system of the object being annotated (default)
'offset points' offset (in points) from the xy value
'polar' you can specify theta, r for the annotation, even in cartesian plots. Note that if you are using a polar axes, you do not need to specify polar for the coordinate system since that is the native "data" coordinate system. Alternatively they can be set to any valid Transform. Note that 'subfigure pixels' and 'figure pixels' are the same for the parent figure, so users who want code that is usable in a subfigure can use 'subfigure pixels'. Note Using ConnectionPatch across two Axes instances is not directly compatible with constrained layout. Add the artist directly to the Figure instead of adding it to a specific Axes, or exclude it from the layout using con.set_in_layout(False). fig, ax = plt.subplots(1, 2, constrained_layout=True)
con = ConnectionPatch(..., axesA=ax[0], axesB=ax[1])
fig.add_artist(con)
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_annotation_clip()[source]
Return the clipping behavior. See set_annotation_clip for the meaning of the return value.
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, annotation_clip=<UNSET>, antialiased=<UNSET>, arrowstyle=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, connectionstyle=<UNSET>, dpi_cor=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mutation_aspect=<UNSET>, mutation_scale=<UNSET>, patchA=<UNSET>, patchB=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, positions=<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
antialiased or aa bool or None
arrowstyle None or ArrowStyle or str, default: None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
connectionstyle str or ConnectionStyle or None, optional
dpi_cor unknown
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
mutation_aspect float
mutation_scale float
patchA patches.Patch
patchB patches.Patch
path_effects AbstractPathEffect
picker None or bool or float or callable
positions unknown
rasterized bool
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
transform Transform
url str
visible bool
zorder float
set_annotation_clip(b)[source]
Set the clipping behavior. Parameters
bbool or None
False: The annotation will always be drawn regardless of its position.
True: The annotation will only be drawn if self.xy is inside the axes.
None: The annotation will only be drawn if self.xy is inside the axes and self.xycoords == "data".
Examples using matplotlib.patches.ConnectionPatch
Bar of pie
Connect Simple01
Constrained Layout Guide
|
matplotlib._as_gen.matplotlib.patches.connectionpatch
|
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.matplotlib.patches.connectionpatch#matplotlib.patches.ConnectionPatch.draw
|
get_annotation_clip()[source]
Return the clipping behavior. See set_annotation_clip for the meaning of the return value.
|
matplotlib._as_gen.matplotlib.patches.connectionpatch#matplotlib.patches.ConnectionPatch.get_annotation_clip
|
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, annotation_clip=<UNSET>, antialiased=<UNSET>, arrowstyle=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, connectionstyle=<UNSET>, dpi_cor=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mutation_aspect=<UNSET>, mutation_scale=<UNSET>, patchA=<UNSET>, patchB=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, positions=<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
antialiased or aa bool or None
arrowstyle None or ArrowStyle or str, default: None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
connectionstyle str or ConnectionStyle or None, optional
dpi_cor unknown
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
mutation_aspect float
mutation_scale float
patchA patches.Patch
patchB patches.Patch
path_effects AbstractPathEffect
picker None or bool or float or callable
positions unknown
rasterized bool
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
transform Transform
url str
visible bool
zorder float
|
matplotlib._as_gen.matplotlib.patches.connectionpatch#matplotlib.patches.ConnectionPatch.set
|
set_annotation_clip(b)[source]
Set the clipping behavior. Parameters
bbool or None
False: The annotation will always be drawn regardless of its position.
True: The annotation will only be drawn if self.xy is inside the axes.
None: The annotation will only be drawn if self.xy is inside the axes and self.xycoords == "data".
|
matplotlib._as_gen.matplotlib.patches.connectionpatch#matplotlib.patches.ConnectionPatch.set_annotation_clip
|
matplotlib.patches.ConnectionStyle classmatplotlib.patches.ConnectionStyle(stylename, **kw)[source]
Bases: matplotlib.patches._Style ConnectionStyle is a container class which defines several connectionstyle classes, which is used to create a path between two points. These are mainly used with FancyArrowPatch. A connectionstyle object can be either created as: ConnectionStyle.Arc3(rad=0.2)
or: ConnectionStyle("Arc3", rad=0.2)
or: ConnectionStyle("Arc3, rad=0.2")
The following classes are defined
Class Name Attrs
Arc3 arc3 rad=0.0
Angle3 angle3 angleA=90, angleB=0
Angle angle angleA=90, angleB=0, rad=0.0
Arc arc angleA=0, angleB=0, armA=None, armB=None, rad=0.0
Bar bar armA=0.0, armB=0.0, fraction=0.3, angle=None An instance of any connection style class is an callable object, whose call signature is: __call__(self, posA, posB,
patchA=None, patchB=None,
shrinkA=2., shrinkB=2.)
and it returns a Path instance. posA and posB are tuples of (x, y) coordinates of the two points to be connected. patchA (or patchB) is given, the returned path is clipped so that it start (or end) from the boundary of the patch. The path is further shrunk by shrinkA (or shrinkB) which is given in points. Return the instance of the subclass with the given style name. classAngle(angleA=90, angleB=0, rad=0.0)[source]
Bases: matplotlib.patches.ConnectionStyle._Base Creates a piecewise continuous quadratic Bezier path between two points. The path has a one passing-through point placed at the intersecting point of two lines which cross the start and end point, and have a slope of angleA and angleB, respectively. The connecting edges are rounded with rad. angleA
starting angle of the path angleB
ending angle of the path rad
rounding radius of the edge connect(posA, posB)[source]
classAngle3(angleA=90, angleB=0)[source]
Bases: matplotlib.patches.ConnectionStyle._Base Creates a simple quadratic Bezier curve between two points. The middle control points is placed at the intersecting point of two lines which cross the start and end point, and have a slope of angleA and angleB, respectively. angleA
starting angle of the path angleB
ending angle of the path connect(posA, posB)[source]
classArc(angleA=0, angleB=0, armA=None, armB=None, rad=0.0)[source]
Bases: matplotlib.patches.ConnectionStyle._Base Creates a piecewise continuous quadratic Bezier path between two points. The path can have two passing-through points, a point placed at the distance of armA and angle of angleA from point A, another point with respect to point B. The edges are rounded with rad.
angleA :
starting angle of the path
angleB :
ending angle of the path
armA :
length of the starting arm
armB :
length of the ending arm
rad :
rounding radius of the edges connect(posA, posB)[source]
classArc3(rad=0.0)[source]
Bases: matplotlib.patches.ConnectionStyle._Base Creates a simple quadratic Bezier curve between two points. The curve is created so that the middle control point (C1) is located at the same distance from the start (C0) and end points(C2) and the distance of the C1 to the line connecting C0-C2 is rad times the distance of C0-C2. rad
curvature of the curve. connect(posA, posB)[source]
classBar(armA=0.0, armB=0.0, fraction=0.3, angle=None)[source]
Bases: matplotlib.patches.ConnectionStyle._Base A line with angle between A and B with armA and armB. One of the arms is extended so that they are connected in a right angle. The length of armA is determined by (armA + fraction x AB distance). Same for armB. Parameters
armAfloat
minimum length of armA
armBfloat
minimum length of armB
fractionfloat
a fraction of the distance between two points that will be added to armA and armB.
anglefloat or None
angle of the connecting line (if None, parallel to A and B) connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle
|
classAngle(angleA=90, angleB=0, rad=0.0)[source]
Bases: matplotlib.patches.ConnectionStyle._Base Creates a piecewise continuous quadratic Bezier path between two points. The path has a one passing-through point placed at the intersecting point of two lines which cross the start and end point, and have a slope of angleA and angleB, respectively. The connecting edges are rounded with rad. angleA
starting angle of the path angleB
ending angle of the path rad
rounding radius of the edge connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle.Angle
|
connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle.Angle.connect
|
classAngle3(angleA=90, angleB=0)[source]
Bases: matplotlib.patches.ConnectionStyle._Base Creates a simple quadratic Bezier curve between two points. The middle control points is placed at the intersecting point of two lines which cross the start and end point, and have a slope of angleA and angleB, respectively. angleA
starting angle of the path angleB
ending angle of the path connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle.Angle3
|
connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle.Angle3.connect
|
classArc(angleA=0, angleB=0, armA=None, armB=None, rad=0.0)[source]
Bases: matplotlib.patches.ConnectionStyle._Base Creates a piecewise continuous quadratic Bezier path between two points. The path can have two passing-through points, a point placed at the distance of armA and angle of angleA from point A, another point with respect to point B. The edges are rounded with rad.
angleA :
starting angle of the path
angleB :
ending angle of the path
armA :
length of the starting arm
armB :
length of the ending arm
rad :
rounding radius of the edges connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle.Arc
|
connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle.Arc.connect
|
classArc3(rad=0.0)[source]
Bases: matplotlib.patches.ConnectionStyle._Base Creates a simple quadratic Bezier curve between two points. The curve is created so that the middle control point (C1) is located at the same distance from the start (C0) and end points(C2) and the distance of the C1 to the line connecting C0-C2 is rad times the distance of C0-C2. rad
curvature of the curve. connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle.Arc3
|
connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle.Arc3.connect
|
classBar(armA=0.0, armB=0.0, fraction=0.3, angle=None)[source]
Bases: matplotlib.patches.ConnectionStyle._Base A line with angle between A and B with armA and armB. One of the arms is extended so that they are connected in a right angle. The length of armA is determined by (armA + fraction x AB distance). Same for armB. Parameters
armAfloat
minimum length of armA
armBfloat
minimum length of armB
fractionfloat
a fraction of the distance between two points that will be added to armA and armB.
anglefloat or None
angle of the connecting line (if None, parallel to A and B) connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle.Bar
|
connect(posA, posB)[source]
|
matplotlib._as_gen.matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle.Bar.connect
|
matplotlib.patches.draw_bbox matplotlib.patches.draw_bbox(bbox, renderer, color='k', trans=None)[source]
A debug function to draw a rectangle around the bounding box returned by an artist's Artist.get_window_extent to test whether the artist is returning the correct bbox.
|
matplotlib._as_gen.matplotlib.patches.draw_bbox
|
matplotlib.patches.Ellipse classmatplotlib.patches.Ellipse(xy, width, height, angle=0, **kwargs)[source]
Bases: matplotlib.patches.Patch A scale-free ellipse. Parameters
xy(float, float)
xy coordinates of ellipse centre.
widthfloat
Total length (diameter) of horizontal axis.
heightfloat
Total length (diameter) of vertical axis.
anglefloat, default: 0
Rotation in degrees anti-clockwise. Notes Valid keyword arguments 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 unknown
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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 propertyangle
Return the angle of the ellipse.
propertycenter
Return the center of the ellipse.
get_angle()[source]
Return the angle of the ellipse.
get_center()[source]
Return the center of the ellipse.
get_height()[source]
Return the height of the ellipse.
get_patch_transform()[source]
Return the Transform instance mapping patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.
get_path()[source]
Return the path of the ellipse.
get_width()[source]
Return the width of the ellipse.
propertyheight
Return the height of the ellipse.
set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<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
angle float
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
center (float, float)
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
height float
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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_angle(angle)[source]
Set the angle of the ellipse. Parameters
anglefloat
set_center(xy)[source]
Set the center of the ellipse. Parameters
xy(float, float)
set_height(height)[source]
Set the height of the ellipse. Parameters
heightfloat
set_width(width)[source]
Set the width of the ellipse. Parameters
widthfloat
propertywidth
Return the width of the ellipse.
Examples using matplotlib.patches.Ellipse
Clipping images with patches
Axes box aspect
Plot a confidence ellipse of a two-dimensional dataset
Scale invariant angle label
Annotating Plots
AnnotationBbox demo
Reference for Matplotlib artists
Dolphins
Ellipse Demo
Hatch demo
Circles, Wedges and Polygons
ggplot style sheet
Grayscale style sheet
Style sheets reference
Anatomy of a figure
Looking Glass
Anchored Artists
Custom projection
Packed-bubble chart
Draw flat objects in 3D plot
Radar chart (aka spider or star chart)
Ellipse With Units
Anchored Box04
Annotate Explain
Simple Annotate01
Legend guide
Transformations Tutorial
Annotations
|
matplotlib._as_gen.matplotlib.patches.ellipse
|
get_angle()[source]
Return the angle of the ellipse.
|
matplotlib._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.get_angle
|
get_center()[source]
Return the center of the ellipse.
|
matplotlib._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.get_center
|
get_height()[source]
Return the height of the ellipse.
|
matplotlib._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.get_height
|
get_patch_transform()[source]
Return the Transform instance mapping patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.
|
matplotlib._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.get_patch_transform
|
get_path()[source]
Return the path of the ellipse.
|
matplotlib._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.get_path
|
get_width()[source]
Return the width of the ellipse.
|
matplotlib._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.get_width
|
set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<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
angle float
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
center (float, float)
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
height float
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set
|
set_angle(angle)[source]
Set the angle of the ellipse. Parameters
anglefloat
|
matplotlib._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_angle
|
set_center(xy)[source]
Set the center of the ellipse. Parameters
xy(float, float)
|
matplotlib._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_center
|
set_height(height)[source]
Set the height of the ellipse. Parameters
heightfloat
|
matplotlib._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_height
|
set_width(width)[source]
Set the width of the ellipse. Parameters
widthfloat
|
matplotlib._as_gen.matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_width
|
matplotlib.patches.FancyArrow classmatplotlib.patches.FancyArrow(x, y, dx, dy, width=0.001, length_includes_head=False, head_width=None, head_length=None, shape='full', overhang=0, head_starts_at_zero=False, **kwargs)[source]
Bases: matplotlib.patches.Polygon Like Arrow, but lets you set head width and head height independently. Parameters
x, yfloat
The x and y coordinates of the arrow base.
dx, dyfloat
The length of the arrow along x and y direction.
widthfloat, default: 0.001
Width of full arrow tail.
length_includes_headbool, default: False
True if head is to be counted in calculating the length.
head_widthfloat or None, default: 3*width
Total width of the full arrow head.
head_lengthfloat or None, default: 1.5*head_width
Length of arrow head.
shape{'full', 'left', 'right'}, default: 'full'
Draw the left-half, right-half, or full arrow.
overhangfloat, default: 0
Fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one.
head_starts_at_zerobool, default: False
If True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0. **kwargs
Patch properties:
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 unknown
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, closed=<UNSET>, color=<UNSET>, data=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xy=<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
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
closed bool
color color
data unknown
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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
xy (N, 2) array-like
zorder float
set_data(*, x=None, y=None, dx=None, dy=None, width=None, head_width=None, head_length=None)[source]
Set FancyArrow x, y, dx, dy, width, head_with, and head_length. Values left as None will not be updated. Parameters
x, yfloat or None, default: None
The x and y coordinates of the arrow base.
dx, dyfloat or None, default: None
The length of the arrow along x and y direction. width: float or None, default: None
Width of full arrow tail. head_width: float or None, default: None
Total width of the full arrow head. head_length: float or None, default: None
Length of arrow head.
Examples using matplotlib.patches.FancyArrow
Arrow guide
|
matplotlib._as_gen.matplotlib.patches.fancyarrow
|
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, closed=<UNSET>, color=<UNSET>, data=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xy=<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
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
closed bool
color color
data unknown
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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
xy (N, 2) array-like
zorder float
|
matplotlib._as_gen.matplotlib.patches.fancyarrow#matplotlib.patches.FancyArrow.set
|
set_data(*, x=None, y=None, dx=None, dy=None, width=None, head_width=None, head_length=None)[source]
Set FancyArrow x, y, dx, dy, width, head_with, and head_length. Values left as None will not be updated. Parameters
x, yfloat or None, default: None
The x and y coordinates of the arrow base.
dx, dyfloat or None, default: None
The length of the arrow along x and y direction. width: float or None, default: None
Width of full arrow tail. head_width: float or None, default: None
Total width of the full arrow head. head_length: float or None, default: None
Length of arrow head.
|
matplotlib._as_gen.matplotlib.patches.fancyarrow#matplotlib.patches.FancyArrow.set_data
|
matplotlib.patches.FancyArrowPatch classmatplotlib.patches.FancyArrowPatch(posA=None, posB=None, path=None, arrowstyle='simple', connectionstyle='arc3', patchA=None, patchB=None, shrinkA=2, shrinkB=2, mutation_scale=1, mutation_aspect=1, dpi_cor=<deprecated parameter>, **kwargs)[source]
Bases: matplotlib.patches.Patch A fancy arrow patch. It draws an arrow using the ArrowStyle. The head and tail positions are fixed at the specified start and end points of the arrow, but the size and shape (in display coordinates) of the arrow does not change when the axis is moved or zoomed. There are two ways for defining an arrow: If posA and posB are given, a path connecting two points is created according to connectionstyle. The path will be clipped with patchA and patchB and further shrunken by shrinkA and shrinkB. An arrow is drawn along this resulting path using the arrowstyle parameter. Alternatively if path is provided, an arrow is drawn along this path and patchA, patchB, shrinkA, and shrinkB are ignored. Parameters
posA, posB(float, float), default: None
(x, y) coordinates of arrow tail and arrow head respectively.
pathPath, default: None
If provided, an arrow is drawn along this path and patchA, patchB, shrinkA, and shrinkB are ignored.
arrowstylestr or ArrowStyle, default: 'simple'
The ArrowStyle with which the fancy arrow is drawn. If a string, it should be one of the available arrowstyle names, with optional comma-separated attributes. The optional attributes are meant to be scaled with the mutation_scale. The following arrow styles are available:
Class Name Attrs
Curve - None
CurveA <- head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
CurveB -> head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
CurveAB <-> head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
CurveFilledA <|- head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
CurveFilledB -|> head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
CurveFilledAB <|-|> head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
BracketA ]- widthA=1.0, lengthA=0.2, angleA=0
BracketB -[ widthB=1.0, lengthB=0.2, angleB=0
BracketAB ]-[ widthA=1.0, lengthA=0.2, angleA=0, widthB=1.0, lengthB=0.2, angleB=0
BarAB |-| widthA=1.0, angleA=0, widthB=1.0, angleB=0
BracketCurve ]-> widthA=1.0, lengthA=0.2, angleA=None
CurveBracket <-[ widthB=1.0, lengthB=0.2, angleB=None
Simple simple head_length=0.5, head_width=0.5, tail_width=0.2
Fancy fancy head_length=0.4, head_width=0.4, tail_width=0.4
Wedge wedge tail_width=0.3, shrink_factor=0.5
connectionstylestr or ConnectionStyle or None, optional, default: 'arc3'
The ConnectionStyle with which posA and posB are connected. If a string, it should be one of the available connectionstyle names, with optional comma-separated attributes. The following connection styles are available:
Class Name Attrs
Arc3 arc3 rad=0.0
Angle3 angle3 angleA=90, angleB=0
Angle angle angleA=90, angleB=0, rad=0.0
Arc arc angleA=0, angleB=0, armA=None, armB=None, rad=0.0
Bar bar armA=0.0, armB=0.0, fraction=0.3, angle=None
patchA, patchBPatch, default: None
Head and tail patches, respectively.
shrinkA, shrinkBfloat, default: 2
Shrinking factor of the tail and head of the arrow respectively.
mutation_scalefloat, default: 1
Value with which attributes of arrowstyle (e.g., head_length) will be scaled.
mutation_aspectNone or float, default: None
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.
dpi_corfloat, default: 1
dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this. Deprecated. Other Parameters
**kwargsPatch properties, optional
Here is a list of available Patch properties:
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 unknown
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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 In contrast to other patches, the default capstyle and joinstyle for FancyArrowPatch are set to "round". 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_arrowstyle()[source]
Return the arrowstyle object.
get_connectionstyle()[source]
Return the ConnectionStyle used.
get_dpi_cor()[source]
[Deprecated] dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this. Returns
scalar
Notes Deprecated since version 3.4.
get_mutation_aspect()[source]
Return the aspect ratio of the bbox mutation.
get_mutation_scale()[source]
Return the mutation scale. Returns
scalar
get_path()[source]
Return the path of the arrow in the data coordinates.
propertyget_path_in_displaycoord[source]
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, arrowstyle=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, connectionstyle=<UNSET>, dpi_cor=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mutation_aspect=<UNSET>, mutation_scale=<UNSET>, patchA=<UNSET>, patchB=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, positions=<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
antialiased or aa bool or None
arrowstyle None or ArrowStyle or str, default: None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
connectionstyle str or ConnectionStyle or None, optional
dpi_cor unknown
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
mutation_aspect float
mutation_scale float
patchA patches.Patch
patchB patches.Patch
path_effects AbstractPathEffect
picker None or bool or float or callable
positions unknown
rasterized bool
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
transform Transform
url str
visible bool
zorder float
set_arrowstyle(arrowstyle=None, **kw)[source]
Set the arrow style. Old attributes are forgotten. Without arguments (or with arrowstyle=None) returns available box styles as a list of strings. Parameters
arrowstyleNone or ArrowStyle or str, default: None
Can be a string with arrowstyle name with optional comma-separated attributes, e.g.: set_arrowstyle("Fancy,head_length=0.2")
Alternatively attributes can be provided as keywords, e.g.: set_arrowstyle("fancy", head_length=0.2)
set_connectionstyle(connectionstyle, **kw)[source]
Set the connection style. Old attributes are forgotten. Parameters
connectionstylestr or ConnectionStyle or None, optional
Can be a string with connectionstyle name with optional comma-separated attributes, e.g.: set_connectionstyle("arc,angleA=0,armA=30,rad=10")
Alternatively, the attributes can be provided as keywords, e.g.: set_connectionstyle("arc", angleA=0,armA=30,rad=10)
Without any arguments (or with connectionstyle=None), return available styles as a list of strings.
set_dpi_cor(dpi_cor)[source]
[Deprecated] dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this. Parameters
dpi_corfloat
Notes Deprecated since version 3.4.
set_mutation_aspect(aspect)[source]
Set the aspect ratio of the bbox mutation. Parameters
aspectfloat
set_mutation_scale(scale)[source]
Set the mutation scale. Parameters
scalefloat
set_patchA(patchA)[source]
Set the tail patch. Parameters
patchApatches.Patch
set_patchB(patchB)[source]
Set the head patch. Parameters
patchBpatches.Patch
set_positions(posA, posB)[source]
Set the begin and end positions of the connecting path. Parameters
posA, posBNone, tuple
(x, y) coordinates of arrow tail and arrow head respectively. If None use current value.
Examples using matplotlib.patches.FancyArrowPatch
Bar of pie
Arrow guide
Connect Simple01
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch
|
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.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.draw
|
get_arrowstyle()[source]
Return the arrowstyle object.
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.get_arrowstyle
|
get_connectionstyle()[source]
Return the ConnectionStyle used.
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.get_connectionstyle
|
get_dpi_cor()[source]
[Deprecated] dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this. Returns
scalar
Notes Deprecated since version 3.4.
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.get_dpi_cor
|
get_mutation_aspect()[source]
Return the aspect ratio of the bbox mutation.
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.get_mutation_aspect
|
get_mutation_scale()[source]
Return the mutation scale. Returns
scalar
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.get_mutation_scale
|
get_path()[source]
Return the path of the arrow in the data coordinates.
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.get_path
|
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, arrowstyle=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, connectionstyle=<UNSET>, dpi_cor=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mutation_aspect=<UNSET>, mutation_scale=<UNSET>, patchA=<UNSET>, patchB=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, positions=<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
antialiased or aa bool or None
arrowstyle None or ArrowStyle or str, default: None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
connectionstyle str or ConnectionStyle or None, optional
dpi_cor unknown
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
mutation_aspect float
mutation_scale float
patchA patches.Patch
patchB patches.Patch
path_effects AbstractPathEffect
picker None or bool or float or callable
positions unknown
rasterized bool
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
transform Transform
url str
visible bool
zorder float
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.set
|
set_arrowstyle(arrowstyle=None, **kw)[source]
Set the arrow style. Old attributes are forgotten. Without arguments (or with arrowstyle=None) returns available box styles as a list of strings. Parameters
arrowstyleNone or ArrowStyle or str, default: None
Can be a string with arrowstyle name with optional comma-separated attributes, e.g.: set_arrowstyle("Fancy,head_length=0.2")
Alternatively attributes can be provided as keywords, e.g.: set_arrowstyle("fancy", head_length=0.2)
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.set_arrowstyle
|
set_connectionstyle(connectionstyle, **kw)[source]
Set the connection style. Old attributes are forgotten. Parameters
connectionstylestr or ConnectionStyle or None, optional
Can be a string with connectionstyle name with optional comma-separated attributes, e.g.: set_connectionstyle("arc,angleA=0,armA=30,rad=10")
Alternatively, the attributes can be provided as keywords, e.g.: set_connectionstyle("arc", angleA=0,armA=30,rad=10)
Without any arguments (or with connectionstyle=None), return available styles as a list of strings.
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.set_connectionstyle
|
set_dpi_cor(dpi_cor)[source]
[Deprecated] dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this. Parameters
dpi_corfloat
Notes Deprecated since version 3.4.
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.set_dpi_cor
|
set_mutation_aspect(aspect)[source]
Set the aspect ratio of the bbox mutation. Parameters
aspectfloat
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.set_mutation_aspect
|
set_mutation_scale(scale)[source]
Set the mutation scale. Parameters
scalefloat
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.set_mutation_scale
|
set_patchA(patchA)[source]
Set the tail patch. Parameters
patchApatches.Patch
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.set_patchA
|
set_patchB(patchB)[source]
Set the head patch. Parameters
patchBpatches.Patch
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.set_patchB
|
set_positions(posA, posB)[source]
Set the begin and end positions of the connecting path. Parameters
posA, posBNone, tuple
(x, y) coordinates of arrow tail and arrow head respectively. If None use current value.
|
matplotlib._as_gen.matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch.set_positions
|
matplotlib.patches.FancyBboxPatch classmatplotlib.patches.FancyBboxPatch(xy, width, height, boxstyle='round', bbox_transmuter=<deprecated parameter>, mutation_scale=1, mutation_aspect=1, **kwargs)[source]
Bases: matplotlib.patches.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. Parameters
xyfloat, float
The lower left corner of the box.
widthfloat
The width of the box.
heightfloat
The height of the box.
boxstylestr or matplotlib.patches.BoxStyle
The style of the fancy box. This can either be a BoxStyle instance or a string of the style name and optionally comma seprarated 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 Attrs
Square square pad=0.3
Circle circle pad=0.3
LArrow larrow pad=0.3
RArrow rarrow pad=0.3
DArrow darrow pad=0.3
Round round pad=0.3, rounding_size=None
Round4 round4 pad=0.3, rounding_size=None
Sawtooth sawtooth pad=0.3, tooth_size=None
Roundtooth roundtooth pad=0.3, tooth_size=None
mutation_scalefloat, default: 1
Scaling factor applied to the attributes of the box style (e.g. pad or rounding_size).
mutation_aspectfloat, default: 1
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. Other Parameters
**kwargsPatch properties
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 unknown
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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 get_bbox()[source]
Return the Bbox.
get_boxstyle()[source]
Return the boxstyle object.
get_height()[source]
Return the height of the rectangle.
get_mutation_aspect()[source]
Return the aspect ratio of the bbox mutation.
get_mutation_scale()[source]
Return the mutation scale.
get_path()[source]
Return the mutated path of the rectangle.
get_width()[source]
Return the width of the rectangle.
get_x()[source]
Return the left coord of the rectangle.
get_y()[source]
Return the bottom coord of the rectangle.
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, bounds=<UNSET>, boxstyle=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mutation_aspect=<UNSET>, mutation_scale=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, x=<UNSET>, y=<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
antialiased or aa bool or None
bounds unknown
boxstyle [ 'square' | 'circle' | 'larrow' | 'rarrow' | 'darrow' | 'round' | 'round4' | 'sawtooth' | 'roundtooth' ]
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
height float
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
mutation_aspect float
mutation_scale 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 Transform
url str
visible bool
width float
x float
y float
zorder float
set_bounds(*args)[source]
Set the bounds of the rectangle. Call signatures: set_bounds(left, bottom, width, height)
set_bounds((left, bottom, width, height))
Parameters
left, bottomfloat
The coordinates of the bottom left corner of the rectangle.
width, heightfloat
The width/height of the rectangle.
set_boxstyle(boxstyle=None, **kwargs)[source]
Set the box style. Most box styles can be further configured using 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. Parameters
boxstylestr or matplotlib.patches.BoxStyle
The style of the fancy box. This can either be a BoxStyle instance or a string of the style name and optionally comma seprarated 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 Attrs
Square square pad=0.3
Circle circle pad=0.3
LArrow larrow pad=0.3
RArrow rarrow pad=0.3
DArrow darrow pad=0.3
Round round pad=0.3, rounding_size=None
Round4 round4 pad=0.3, rounding_size=None
Sawtooth sawtooth pad=0.3, tooth_size=None
Roundtooth roundtooth pad=0.3, tooth_size=None **kwargs
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)
set_height(h)[source]
Set the rectangle height. Parameters
hfloat
set_mutation_aspect(aspect)[source]
Set the aspect ratio of the bbox mutation. Parameters
aspectfloat
set_mutation_scale(scale)[source]
Set the mutation scale. Parameters
scalefloat
set_width(w)[source]
Set the rectangle width. Parameters
wfloat
set_x(x)[source]
Set the left coord of the rectangle. Parameters
xfloat
set_y(y)[source]
Set the bottom coord of the rectangle. Parameters
yfloat
Examples using matplotlib.patches.FancyBboxPatch
Reference for Matplotlib artists
Drawing fancy boxes
Annotate Text Arrow
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch
|
get_bbox()[source]
Return the Bbox.
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.get_bbox
|
get_boxstyle()[source]
Return the boxstyle object.
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.get_boxstyle
|
get_height()[source]
Return the height of the rectangle.
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.get_height
|
get_mutation_aspect()[source]
Return the aspect ratio of the bbox mutation.
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.get_mutation_aspect
|
get_mutation_scale()[source]
Return the mutation scale.
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.get_mutation_scale
|
get_path()[source]
Return the mutated path of the rectangle.
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.get_path
|
get_width()[source]
Return the width of the rectangle.
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.get_width
|
get_x()[source]
Return the left coord of the rectangle.
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.get_x
|
get_y()[source]
Return the bottom coord of the rectangle.
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.get_y
|
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, bounds=<UNSET>, boxstyle=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mutation_aspect=<UNSET>, mutation_scale=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, x=<UNSET>, y=<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
antialiased or aa bool or None
bounds unknown
boxstyle [ 'square' | 'circle' | 'larrow' | 'rarrow' | 'darrow' | 'round' | 'round4' | 'sawtooth' | 'roundtooth' ]
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
height float
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
mutation_aspect float
mutation_scale 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 Transform
url str
visible bool
width float
x float
y float
zorder float
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.set
|
set_bounds(*args)[source]
Set the bounds of the rectangle. Call signatures: set_bounds(left, bottom, width, height)
set_bounds((left, bottom, width, height))
Parameters
left, bottomfloat
The coordinates of the bottom left corner of the rectangle.
width, heightfloat
The width/height of the rectangle.
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.set_bounds
|
set_boxstyle(boxstyle=None, **kwargs)[source]
Set the box style. Most box styles can be further configured using 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. Parameters
boxstylestr or matplotlib.patches.BoxStyle
The style of the fancy box. This can either be a BoxStyle instance or a string of the style name and optionally comma seprarated 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 Attrs
Square square pad=0.3
Circle circle pad=0.3
LArrow larrow pad=0.3
RArrow rarrow pad=0.3
DArrow darrow pad=0.3
Round round pad=0.3, rounding_size=None
Round4 round4 pad=0.3, rounding_size=None
Sawtooth sawtooth pad=0.3, tooth_size=None
Roundtooth roundtooth pad=0.3, tooth_size=None **kwargs
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._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.set_boxstyle
|
set_height(h)[source]
Set the rectangle height. Parameters
hfloat
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.set_height
|
set_mutation_aspect(aspect)[source]
Set the aspect ratio of the bbox mutation. Parameters
aspectfloat
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.set_mutation_aspect
|
set_mutation_scale(scale)[source]
Set the mutation scale. Parameters
scalefloat
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.set_mutation_scale
|
set_width(w)[source]
Set the rectangle width. Parameters
wfloat
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.set_width
|
set_x(x)[source]
Set the left coord of the rectangle. Parameters
xfloat
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.set_x
|
set_y(y)[source]
Set the bottom coord of the rectangle. Parameters
yfloat
|
matplotlib._as_gen.matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch.set_y
|
matplotlib.patches.Patch classmatplotlib.patches.Patch(edgecolor=None, facecolor=None, color=None, linewidth=None, linestyle=None, antialiased=None, hatch=None, fill=True, capstyle=None, joinstyle=None, **kwargs)[source]
Bases: matplotlib.artist.Artist A patch is a 2D artist with a face color and an edge color. If any of edgecolor, facecolor, linewidth, or antialiased are None, they default to their rc params setting. The following kwarg properties are supported
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 unknown
animated bool
antialiased or aa bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor or ec color or None
facecolor or fc color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float or None
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 contains(mouseevent, radius=None)[source]
Test whether the mouse event occurred in the patch. Returns
(bool, empty dict)
contains_point(point, radius=None)[source]
Return whether the given point is inside the patch. Parameters
point(float, float)
The point (x, y) to check, in target coordinates of self.get_transform(). These are display coordinates for patches that are added to a figure or axes.
radiusfloat, optional
Add an additional margin on the patch in target coordinates of self.get_transform(). See Path.contains_point for further details. Returns
bool
Notes The proper use of this method depends on the transform of the patch. Isolated patches do not have a transform. In this case, the patch creation coordinates and the point coordinates match. The following example checks that the center of a circle is within the circle >>> center = 0, 0
>>> c = Circle(center, radius=1)
>>> c.contains_point(center)
True
The convention of checking against the transformed patch stems from the fact that this method is predominantly used to check if display coordinates (e.g. from mouse events) are within the patch. If you want to do the above check with data coordinates, you have to properly transform them first: >>> center = 0, 0
>>> c = Circle(center, radius=1)
>>> plt.gca().add_patch(c)
>>> transformed_center = c.get_transform().transform(center)
>>> c.contains_point(transformed_center)
True
contains_points(points, radius=None)[source]
Return whether the given points are inside the patch. Parameters
points(N, 2) array
The points to check, in target coordinates of self.get_transform(). These are display coordinates for patches that are added to a figure or axes. Columns contain x and y values.
radiusfloat, optional
Add an additional margin on the patch in target coordinates of self.get_transform(). See Path.contains_point for further details. Returns
length-N bool array
Notes The proper use of this method depends on the transform of the patch. See the notes on Patch.contains_point.
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.
propertyfill
Return whether the patch is filled.
get_aa()[source]
Alias for get_antialiased.
get_antialiased()[source]
Return whether antialiasing is used for drawing.
get_capstyle()[source]
Return the capstyle.
get_data_transform()[source]
Return the Transform mapping data coordinates to physical coordinates.
get_ec()[source]
Alias for get_edgecolor.
get_edgecolor()[source]
Return the edge color.
get_extents()[source]
Return the Patch's axis-aligned extents as a Bbox.
get_facecolor()[source]
Return the face color.
get_fc()[source]
Alias for get_facecolor.
get_fill()[source]
Return whether the patch is filled.
get_hatch()[source]
Return the hatching pattern.
get_joinstyle()[source]
Return the joinstyle.
get_linestyle()[source]
Return the linestyle.
get_linewidth()[source]
Return the line width in points.
get_ls()[source]
Alias for get_linestyle.
get_lw()[source]
Alias for get_linewidth.
get_patch_transform()[source]
Return the Transform instance mapping patch coordinates to data coordinates. For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.
get_path()[source]
Return the path of this patch.
get_transform()[source]
Return the Transform applied to the Patch.
get_verts()[source]
Return a copy of the vertices used in this patch. If the patch contains Bezier curves, the curves will be interpolated by line segments. To access the curves as curves, use get_path.
get_window_extent(renderer=None)[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>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<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 unknown
animated bool
antialiased bool or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
edgecolor color or None
facecolor color or None
figure Figure
fill bool
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth float or None
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_aa(aa)[source]
Alias for set_antialiased.
set_alpha(alpha)[source]
Set the alpha value used for blending - not supported on all backends. Parameters
alphascalar or None
alpha must be within the 0-1 range, inclusive.
set_antialiased(aa)[source]
Set whether to use antialiased rendering. Parameters
aabool or None
set_capstyle(s)[source]
Set the CapStyle. Parameters
sCapStyle or {'butt', 'projecting', 'round'}
set_color(c)[source]
Set both the edgecolor and the facecolor. Parameters
ccolor
See also
Patch.set_facecolor, Patch.set_edgecolor
For setting the edge or face color individually.
set_ec(color)[source]
Alias for set_edgecolor.
set_edgecolor(color)[source]
Set the patch edge color. Parameters
colorcolor or None
set_facecolor(color)[source]
Set the patch face color. Parameters
colorcolor or None
set_fc(color)[source]
Alias for set_facecolor.
set_fill(b)[source]
Set whether to fill the patch. Parameters
bbool
set_hatch(hatch)[source]
Set the hatching pattern. hatch can be one of: / - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Parameters
hatch{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
set_joinstyle(s)[source]
Set the JoinStyle. Parameters
sJoinStyle or {'miter', 'round', 'bevel'}
set_linestyle(ls)[source]
Set the patch linestyle.
linestyle description
'-' or 'solid' solid line
'--' or 'dashed' dashed line
'-.' or 'dashdot' dash-dotted line
':' or 'dotted' dotted line
'none', 'None', ' ', or '' draw nothing Alternatively a dash tuple of the following form can be provided: (offset, onoffseq)
where onoffseq is an even length tuple of on and off ink in points. Parameters
ls{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
The line style.
set_linewidth(w)[source]
Set the patch linewidth in points. Parameters
wfloat or None
set_ls(ls)[source]
Alias for set_linestyle.
set_lw(w)[source]
Alias for set_linewidth.
update_from(other)[source]
Copy properties from other to self.
validCap=('butt', 'projecting', 'round')
validJoin=('miter', 'round', 'bevel')
zorder=1
Examples using matplotlib.patches.Patch
Curve with error band
Stairs Demo
Clipping images with patches
Image Demo
Axes box aspect
Controlling view limits using margins and sticky_edges
Axes Zoom Effect
Boxplots
Plot a confidence ellipse of a two-dimensional dataset
Creating boxes from error bars using PatchCollection
Bar of pie
Scale invariant angle label
Annotating Plots
Composing Custom Legends
AnnotationBbox demo
Using a text as a Path
Text Rotation Mode
Precise text layout
Text Layout
List of named colors
Arrow guide
Reference for Matplotlib artists
Compound path
Dolphins
Mmh Donuts!!!
Ellipse Demo
Drawing fancy boxes
Hatch demo
Hatch style reference
Circles, Wedges and Polygons
PathPatch object
Bezier Curve
ggplot style sheet
Grayscale style sheet
Style sheets reference
Inset Locator Demo
Anatomy of a figure
Firefox
Integral as the area under a curve
Looking Glass
Path Editor
Pick Event Demo
Poly Editor
Trifinder Event Demo
Viewlims
Anchored Artists
Changing colors of lines intersecting a box
Custom projection
Building histograms using Rectangles and PolyCollections
Matplotlib logo
Packed-bubble chart
SVG Filter Pie
TickedStroke patheffect
Draw flat objects in 3D plot
Hinton diagrams
Radar chart (aka spider or star chart)
SkewT-logP diagram: using transforms and custom projections
Artist tests
Ellipse With Units
Anchored Box04
Annotate Explain
Connect Simple01
Simple Annotate01
Menu
Artist tutorial
Legend guide
Path Tutorial
Transformations Tutorial
Specifying Colors
Text properties and layout
Annotations
|
matplotlib._as_gen.matplotlib.patches.patch
|
contains(mouseevent, radius=None)[source]
Test whether the mouse event occurred in the patch. Returns
(bool, empty dict)
|
matplotlib._as_gen.matplotlib.patches.patch#matplotlib.patches.Patch.contains
|
contains_point(point, radius=None)[source]
Return whether the given point is inside the patch. Parameters
point(float, float)
The point (x, y) to check, in target coordinates of self.get_transform(). These are display coordinates for patches that are added to a figure or axes.
radiusfloat, optional
Add an additional margin on the patch in target coordinates of self.get_transform(). See Path.contains_point for further details. Returns
bool
Notes The proper use of this method depends on the transform of the patch. Isolated patches do not have a transform. In this case, the patch creation coordinates and the point coordinates match. The following example checks that the center of a circle is within the circle >>> center = 0, 0
>>> c = Circle(center, radius=1)
>>> c.contains_point(center)
True
The convention of checking against the transformed patch stems from the fact that this method is predominantly used to check if display coordinates (e.g. from mouse events) are within the patch. If you want to do the above check with data coordinates, you have to properly transform them first: >>> center = 0, 0
>>> c = Circle(center, radius=1)
>>> plt.gca().add_patch(c)
>>> transformed_center = c.get_transform().transform(center)
>>> c.contains_point(transformed_center)
True
|
matplotlib._as_gen.matplotlib.patches.patch#matplotlib.patches.Patch.contains_point
|
contains_points(points, radius=None)[source]
Return whether the given points are inside the patch. Parameters
points(N, 2) array
The points to check, in target coordinates of self.get_transform(). These are display coordinates for patches that are added to a figure or axes. Columns contain x and y values.
radiusfloat, optional
Add an additional margin on the patch in target coordinates of self.get_transform(). See Path.contains_point for further details. Returns
length-N bool array
Notes The proper use of this method depends on the transform of the patch. See the notes on Patch.contains_point.
|
matplotlib._as_gen.matplotlib.patches.patch#matplotlib.patches.Patch.contains_points
|
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.matplotlib.patches.patch#matplotlib.patches.Patch.draw
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.