sfepy/sfepy — Issue #66: live plotting
Author: rc
Created: 2012-01-30 10:25:17+00:00
State: open

Plotting curves while doing computations is cool, but currently the plot is
freezed/does not repaint until pylab.show() is called, which in turn
freezes the computation.

To resolve this, plotting would have to be done in a separate thread.

Migrated from http://code.google.com/p/sfepy/issues/detail?id=62

earlier comments

ondrej.certik said, at 2008-11-13T14:39:21.000Z:

Well, but Python doesn't have threads, only "threads", right? Maybe use multiprocessing?

robert.cimrman said, at 2008-11-13T14:45:17.000Z:

Yep. It seems there is no an easy way to run a GUI event-loop outside the main
thread. I have now looked at my matplotlib archives and found that the only reliable
option is probably using a separate process. How is it done in ipython, do you have
any idea?

ondrej.certik said, at 2008-11-13T14:54:44.000Z:

No, but multiprocessing uses a separate process, so it should work nicely. Let me
know how it goes.

robert.cimrman said, at 2008-11-13T16:13:30.000Z:

The multiprocessing package [1] looks good, but is new in 2.6 - I will try [2] (which
looks the same).

[1] http://docs.python.org/dev/library/multiprocessing.html
[2] http://pyprocessing.berlios.de/

ondrej.certik said, at 2008-11-13T16:17:11.000Z:

Use this:

http://code.google.com/p/python-multiprocessing/

robert.cimrman said, at 2008-11-13T16:22:36.000Z:

Nice, was not aware of it. As "The multiprocessing package itself is a renamed and
updated version of R Oudkerk's pyprocessing package.", I may try both (pyprocessing
is in gentoo repo).

ondrej.certik said, at 2008-11-13T16:32:15.000Z:

Yeah, but there may be more api changes. Anyway, please report how it goes.

robert.cimrman said, at 2008-11-20T14:28:18.000Z:

Changeset http://hg.sympy.org/sfepy/rev/c32c3c739968 implements the live plotting
using the multiprocessing module + GTKAgg backend.