On this page
matplotlib.patches.FancyArrowPatch
class matplotlib.patches.FancyArrowPatch(posA=None, posB=None, path=None, arrowstyle='simple', arrow_transmuter=None, connectionstyle='arc3', connector=None, patchA=None, patchB=None, shrinkA=2, shrinkB=2, mutation_scale=1, mutation_aspect=None, dpi_cor=1, **kwargs)[source]-
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.
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 : None, tuple, optional (default: None) -
(x,y) coordinates of arrow tail and arrow head respectively.
-
path : None, Path (default: None) -
matplotlib.path.Pathinstance. If provided, an arrow is drawn along this path and patchA, patchB, shrinkA, and shrinkB are ignored. -
arrowstyle : str or ArrowStyle, optional (default: 'simple') -
Describes how the fancy arrow will be drawn. It can be string of the available arrowstyle names, with optional comma-separated attributes, or an
ArrowStyleinstance. The optional attributes are meant to be scaled with the mutation_scale. The following arrow styles are available:Class Name Attrs Curve -None CurveB ->head_length=0.4,head_width=0.2 BracketB -[widthB=1.0,lengthB=0.2,angleB=None CurveFilledB -|>head_length=0.4,head_width=0.2 CurveA <-head_length=0.4,head_width=0.2 CurveAB <->head_length=0.4,head_width=0.2 CurveFilledA <|-head_length=0.4,head_width=0.2 CurveFilledAB <|-|>head_length=0.4,head_width=0.2 BracketA ]-widthA=1.0,lengthA=0.2,angleA=None BracketAB ]-[widthA=1.0,lengthA=0.2,angleA=None,widthB=1.0,lengthB=0.2,angleB=None Fancy fancyhead_length=0.4,head_width=0.4,tail_width=0.4 Simple simplehead_length=0.5,head_width=0.5,tail_width=0.2 Wedge wedgetail_width=0.3,shrink_factor=0.5 BarAB |-|widthA=1.0,angleA=None,widthB=1.0,angleB=None - arrow_transmuter :
-
Ignored
-
connectionstyle : str, ConnectionStyle, or None, optional - (default: 'arc3')
-
Describes how posA and posB are connected. It can be an instance of the
ConnectionStyleclass or a string of the connectionstyle name, with optional comma-separated attributes. The following connection styles are available:Class Name Attrs Angle angleangleA=90,angleB=0,rad=0.0 Angle3 angle3angleA=90,angleB=0 Arc arcangleA=0,angleB=0,armA=None,armB=None,rad=0.0 Arc3 arc3rad=0.0 Bar bararmA=0.0,armB=0.0,fraction=0.3,angle=None - connector :
-
Ignored
-
patchA, patchB : None, Patch, optional (default: None) -
Head and tail patch respectively.
matplotlib.patch.Patchinstance. -
shrinkA, shrinkB : scalar, optional (default: 2) -
Shrinking factor of the tail and head of the arrow respectively
-
mutation_scale : scalar, optional (default: 1) -
Value with which attributes of arrowstyle (e.g., head_length) will be scaled.
-
mutation_aspect : None, scalar, optional (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_cor : scalar, optional (default: 1) -
dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this.
Notes
Valid kwargs are:
Property Description agg_filtera filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array alphafloat or None animatedbool antialiasedor aabool or None capstyle['butt' | 'round' | 'projecting'] clip_boxa Bboxinstanceclip_onbool clip_path[( Path,Transform) |Patch| None]colormatplotlib color spec containsa callable function edgecoloror ecmpl color spec, None, 'none', or 'auto' facecoloror fcmpl color spec, or None for default, or 'none' for no color figurea Figureinstancefillbool gidan id string hatch['/' | '\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*'] joinstyle['miter' | 'round' | 'bevel'] labelobject linestyleor ls['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) | '-'|'--'|'-.'|':'|'None'|' '|'']linewidthor lwfloat or None for default path_effectsAbstractPathEffectpicker[None | bool | float | callable] rasterizedbool or None sketch_params(scale: float, length: float, randomness: float) snapbool or None transformTransformurla url string visiblebool zorderfloat get_arrowstyle()[source]-
Return the arrowstyle object.
get_connectionstyle()[source]-
Return the
ConnectionStyleinstance.
get_dpi_cor()[source]-
dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this.
Returns: -
dpi_cor : scalar
-
get_mutation_aspect()[source]-
Return the aspect ratio of the bbox mutation.
get_mutation_scale()[source]-
Return the mutation scale.
Returns: -
scale : scalar
-
get_path()[source]-
Return the path of the arrow in the data coordinates. Use get_path_in_displaycoord() method to retrieve the arrow path in display coordinates.
get_path_in_displaycoord()[source]-
Return the mutated path of the arrow in display coordinates.
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: -
arrowstyle : None, ArrowStyle, str, optional (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: -
connectionstyle : None, ConnectionStyle instance, or string -
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]-
dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this.
Parameters: -
dpi_cor : scalar
-
set_mutation_aspect(aspect)[source]-
Set the aspect ratio of the bbox mutation.
Parameters: -
aspect : scalar
-
set_mutation_scale(scale)[source]-
Set the mutation scale.
Parameters: -
scale : scalar
-
set_patchA(patchA)[source]-
Set the tail patch.
Parameters: -
patchA : Patch -
matplotlib.patch.Patchinstance.
-
set_patchB(patchB)[source]-
Set the head patch.
Parameters: -
patchB : Patch -
matplotlib.patch.Patchinstance.
-
-
© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/2.2.3/api/_as_gen/matplotlib.patches.FancyArrowPatch.html