[Numpy-discussion] Impossible to draw a direction of arrows in Python???
Andreas Hilboll
lists at hilboll.de
Fri Apr 12 05:36:48 EDT 2013
> Hi,
> I have encountered some problem while I was drawing a direction of
> arrow. I have point (x,y) coordinates and angle of them. What I want to
> do is that to draw arrow according to the given angle (just to show the
> point direction as an arrow in each point coordinate). Here, we should
> assume coordinates of '+x', '+y', '-x ', '-y' are 90, 0, 270, 180
> degrees, respectively.
> I am a bit unfamiliar with Python drawing tools. I am still not sure to
> draw directional point (arrow based on angle) whether I use pylab or
> some other modules or.. still not sure at all. I put the following codes
> as a sample to give better description:
>
> import numpy as np
> import scipy as sp
> import pylab as pl
>
> def draw_line(x,y,angle):
> # Inputs:
> x = np.array([ 2, 4, 8, 10, 12, 14, 16])
> y = np.array([ 5, 10, 15, 20, 25, 30, 35])
> angles = np.array([45,275,190,100,280,18,45])
>
> # First, draw (x,y) coordinate
> ???
> # Second, according to the angle indicate the direction as
> an arrow
> ???
>
> Thanks in advance for your friendly support,
Hi Happyman,
your question would be better suited to the matplotlib-users mailing
list, pleaes re-post there.
I think mpl has a quiver method to do what you want, but I'm not sure.
Check the docs at matplotlib.org.
Cheers, A.
More information about the NumPy-Discussion
mailing list