Can matplotlib be used in scripts with multiple processes, such as
when using the multiprocessing module?
I had some difficulty getting code to work in which I was carrying out
some long computations and wanted to show intermediate results in a
separate process so as not to interrupt the main computation. The
problem distilled down to trying to use the multiprocessing module and
matplotlib together. This is a code snippet which I expected to work,
but doesn't. Is this a matplotlib issue, some intricate issue with
GUIs and processes, or something with my understanding of the subject?
Would you expect this code to work? Is there any easy workaround?
from pylab import *
a = arange(1, 10, 0.1)
newprocess = multiprocessing.Process(target=self.plotter)
if __name__== '__main__':
a = myclass()