470,613 Members | 2,311 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,613 developers. It's quick & easy.

pylab: plot update

Hi,
I need to do a plot of data that is beeing acuired. For that the plot
needs to be updated after aquiering a new tuple.
At the moment I allways do this after a new tuple is aqcuired:

plot(ar[0,i-1:i],br[1,i-1:i],'ro')
show()
#ar is arrays were the new tuple is put in position [0,i] and [1,i]

After that i call sleep(5) until I can acuire the next tuple.
But during that I can't use the zoom/pan, save etc in the window.

Moreover the first time I call plot and show the first point is drawn
correctly but I have to close the window otherwise the program does not
run any further. But after closing the window ones it runs without any
problems.

Is there any better way to do this easily?

Thanks,
Jan
Jul 19 '05 #1
1 2789

Jan> After that i call sleep(5) until I can acuire the next tuple.
Jan> But during that I can't use the zoom/pan, save etc in the window.

...

Jan> Is there any better way to do this easily?

Set a timeout. How to do that depends on what gui tools you are using.
I've never used pylab so I don't know how it integrates with the rest of
your app.

If you're using PyGTK, something like this should suffice:

gobject.timeout_add(5000, update_plot)

where the update_plot function executes your acquisition/plot code. It
needs to return True if you want it to be triggered every five seconds,
otherwise it's a one-shot.

Skip
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Charles Krug | last post: by
reply views Thread by ajikoe | last post: by
6 posts views Thread by googlinggoogler | last post: by
2 posts views Thread by Gary Wessle | last post: by
1 post views Thread by oyinbo55 | last post: by
3 posts views Thread by Willem-Jan Vriend | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.