Plotting Arrows

I’d like to plot some arrows. I can use the pyplot.arrow function but it does not give an arrow head. I am trying to use FancyArrow in the following way:

import matplotlib as mpl

import matplotlib.pyplot as plt


ax = plt.gca()

arr = mpl.patches.FancyArrowPatch((0,0),(3,2),arrowstyle=‘simple’)


but I get “ValueError: Given lines do not intersect” in the file. (Full traceback below)

Thanks for any hints!


Traceback (most recent call last):

File “M:\mypy\”, line 8, in


File “C:\Python26\lib\site-packages\matplotlib\”, line 1453, in add_patch


File “C:\Python26\lib\site-packages\matplotlib\”, line 1469, in _update_patch_limits

vertices = patch.get_path().vertices

File “C:\Python26\lib\site-packages\matplotlib\”, line 3792, in get_path

_path, fillable = self.get_path_in_displaycoord()

File “C:\Python26\lib\site-packages\matplotlib\”, line 3822, in get_path_in_displaycoord


File “C:\Python26\lib\site-packages\matplotlib\”, line 2845, in call

return self.transmute(path, mutation_size, linewidth)

File “C:\Python26\lib\site-packages\matplotlib\”, line 3384, in transmute

tail_left, tail_right = get_parallels(arrow_out, tail_width/2.)

File “C:\Python26\lib\site-packages\matplotlib\”, line 359, in get_parallels

c2x_left, c2y_left, cos_t2, sin_t2)

File “C:\Python26\lib\site-packages\matplotlib\”, line 34, in get_intersection

raise ValueError(“Given lines do not intersect”)

ValueError: Given lines do not intersect

The function arrow() works for me (Python 2.6.5, matplotlib 99.1.2).
Perhaps something in your installation needs to be changed.

You might try pylab.Arrow() to create patches or perhaps quiver() which
draws a whole set of arrows.