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)
    ax.add_patch( a )
    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)
    ax.add_patch( a )
    draw_if_interactive()
    return a

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

**********************************************************************
Samuel M. Smith Ph.D.
2966 Fort Hill Road
Eagle Mountain, Utah 84043
801-768-2768 voice
801-768-2769 fax
**********************************************************************
"The greatest source of failure and unhappiness in the world is
giving up what we want most for what we want at the moment"
**********************************************************************