# drawing an arrow

Thanks for pointing out this drawing arrow patch.
I wrote a quick function to use this.
Figuring out the correct width to use requires some experimentation.
It would be nice if we could eventually have a line with a regular
line width, and a nicely sized arrow head. (Any ideas?).
But this gives nices results.
Mark

from pylab import *
def draw_arrow( x, y, dx, dy, width=1, color = 'k' ):
ax = gca()
a = Arrow( x, y, dx, dy, width )
a.set_edgecolor(color)
a.set_facecolor(color)
draw_if_interactive()
return a

How did you find out how to use a patch? Trial and Error?
I couldn't find any documentation other than http://matplotlib.sourceforge.net/matplotlib.patches.html
and that doesn't show how to use it.

···

On 06 Oct, 2005, at 20:26, Mark Bakker wrote:

Thanks for pointing out this drawing arrow patch.
I wrote a quick function to use this.
Figuring out the correct width to use requires some experimentation.
It would be nice if we could eventually have a line with a regular
line width, and a nicely sized arrow head. (Any ideas?).
But this gives nices results.
Mark

from pylab import *
def draw_arrow( x, y, dx, dy, width=1, color = 'k' ):
ax = gca()
a = Arrow( x, y, dx, dy, width )
a.set_edgecolor(color)
a.set_facecolor(color)
draw_if_interactive()
return a

-------------------------------------------------------
This SF.Net email is sponsored by:
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

**********************************************************************
Samuel M. Smith Ph.D.