pylab: plot update

Skip Montanaro skip at pobox.com
Wed May 11 10:48:21 EDT 2005


    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



More information about the Python-list mailing list