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.


On 09/26/2010 08:11 AM, Gus Ishere wrote:
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

plt.figure(None)
ax = plt.gca()

arr = mpl.patches.FancyArrowPatch((0,0),(3,2),arrowstyle='simple')
ax.add_patch(arr)

plt.show()

but I get "ValueError: Given lines do not intersect" in the bezier.py file. (Full traceback below)

Thanks for any hints!
Gus



Traceback (most recent call last):
  File "M:\mypy\minimum.py", line 8, in <module>
    ax.add_patch(arr)
File "C:\Python26\lib\site-packages\matplotlib\axes.py", line 1453, in add_patch
    self._update_patch_limits(p)
File "C:\Python26\lib\site-packages\matplotlib\axes.py", line 1469, in _update_patch_limits
    vertices = patch.get_path().vertices
File "C:\Python26\lib\site-packages\matplotlib\patches.py", line 3792, in get_path
    _path, fillable = self.get_path_in_displaycoord()
File "C:\Python26\lib\site-packages\matplotlib\patches.py", line 3822, in get_path_in_displaycoord
    self.get_mutation_aspect()
File "C:\Python26\lib\site-packages\matplotlib\patches.py", line 2845, in __call__
    return self.transmute(path, mutation_size, linewidth)
File "C:\Python26\lib\site-packages\matplotlib\patches.py", line 3384, in transmute
    tail_left, tail_right = get_parallels(arrow_out, tail_width/2.)
File "C:\Python26\lib\site-packages\matplotlib\bezier.py", line 359, in get_parallels
    c2x_left, c2y_left, cos_t2, sin_t2)
File "C:\Python26\lib\site-packages\matplotlib\bezier.py", line 34, in get_intersection
    raise ValueError("Given lines do not intersect")
ValueError: Given lines do not intersect


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev


_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to