matplotlib.pyplot.arrow#

matplotlib.pyplot.arrow(x,y,dx,dy,**kwargs)[source]#

[Discouraged] Add an arrow to the Axes.

This draws an arrow from(x,y) to(x+dx,y+dy).

Discouraged

The use of this method is discouraged because it is not guaranteedthat the arrow renders reasonably. For example, the resulting arrowis affected by the Axes aspect ratio and limits, which may distortthe arrow.

Consider usingannotate without a text instead, e.g.

ax.annotate("",xytext=(0,0),xy=(0.5,0.5),arrowprops=dict(arrowstyle="->"))
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 meanstriangular shape). Can be negative or greater than one.

head_starts_at_zerobool, default: False

If True, the head starts being drawn at coordinate 0instead 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 and two offsets from the bottom left corner of the image

alpha

unknown

animated

bool

antialiased oraa

bool or None

capstyle

CapStyle or {'butt', 'projecting', 'round'}

clip_box

BboxBase or None

clip_on

bool

clip_path

Patch or (Path, Transform) or None

color

color

edgecolor orec

color or None

facecolor orfc

color or None

figure

Figure orSubFigure

fill

bool

gid

str

hatch

{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}

hatch_linewidth

unknown

hatchcolor

color or 'edge' or None

in_layout

bool

joinstyle

JoinStyle or {'miter', 'round', 'bevel'}

label

object

linestyle orls

{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}

linewidth orlw

float or None

mouseover

bool

path_effects

list ofAbstractPathEffect

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

Returns:
FancyArrow

The createdFancyArrow object.

Notes

Note

This is thepyplot wrapper foraxes.Axes.arrow.

On this page