views:

33

answers:

1

I will have a set of data (x, y, heading), and I need to animate it in real-time. I am currently using matplotlib to animate (x, y) and it works fine, but I would really like to have some way to indicate heading, ie what direction the object is facing. What would be the best library for this? It seems like PyGame might be able to help me out, but would I have to roll out my own graphing library for it?

Thanks

+1  A: 

How about quiver? The examples all use a mesh grid, but of course you can simply give the coordinates of arbitrary points:

quiver([1,2,3],[3,1,4],[.5,.4,-.6],[.5,-.7,.3])
xlim(0,4)
ylim(0,5)
show()

The xlim and ylim calls are because quiver doesn't do a very good job of setting the limits automatically.

Jouni K. Seppänen
I'm having trouble understanding how I can use `quiver` to accomplish what I want to. It seems to be a tool for plotting vector fields. How would I go about plotting arbitrary points?
mellort
Updated answer.
Jouni K. Seppänen
Cool. For animation, how would I go about updating the data? I'm thinking something like`line, = quiver ...` then`line.set_xdata(..)`etc.
mellort