You need to adjust the keyword arguments, such as head_width, etc. The
arrow command itself is poorly documented and its keyword arguments
are explained in
matplitlib.patches.FancyArrow. However, I recommend you to use
annotate command instead of arrow (you can give empty string if you
just need an arrow). For example,

annotate("", (0.2, 0.2), (0.4, 0.4),
               arrowprops=dict(arrowstyle="->"))

more examples,

http://matplotlib.sourceforge.net/examples/pylab_examples/annotation_demo.html
http://matplotlib.sourceforge.net/examples/pylab_examples/annotation_demo2.html

Annotate does not adjust the xlim and ylim of your axes for you, thus
it is your responsibility.

-JJ


On Wed, Mar 25, 2009 at 6:39 PM, Sandro Tosi <mo...@debian.org> wrote:
> Hello,
> I'm trying to use arrows but I'm a little stuck.
>
> In [1]: import matplotlib
>
> In [2]: matplotlib.__version__
> Out[2]: '0.98.5.3'
>
> First, simply
>
> import matplotlib.pyplot as plt
> plt.arrow(2,2,4,1)
>
> doesn't show anything, while at least a figure with an arrow in is
> expected (or it's by design?)
>
> Secondly, with this simple script:
>
> import matplotlib.pyplot as plt
> plt.plot(range(10))
> plt.arrow(2,2,4,1, linewidth=5)
> plt.arrow(3,3,1,4)
>
> the result is quite ugly :) Where is the arrow pointer (for example)?
>
> I hope I'm missing something, but even in examples like "usetex_demo"
> the arrows are drawn "by hand" :)
>
> Thanks,
> --
> Sandro Tosi (aka morph, morpheus, matrixhasu)
> My website: http://matrixhasu.altervista.org/
> Me at Debian: http://wiki.debian.org/SandroTosi
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to