Edited - Python plot persistence windows
<p>Each time I launch my program, my plots are erased after each execution.</p>

<p>I would like the following situation:</p>

<ol>
<li>Launch program 1 and plot in figure 1</li>
<li>Stop the execution of program 1</li>
<li>Lauch program 2 and plot in figure 1</li>
<li>Retrieve a pdf file where the plot of program 1 and program 2 are superimposed</li>
</ol>

<p>here is my code:</p>

<pre class="lang-python prettyprint-override"><code>z = np.zeros(5) 
fig,axarr = plt.subplots(nrows=2, ncols=3)
fig.subplots_adjust()

lig,col = 0,0
axarr[lig,col].plot(tt,z[0,:],'k')

#plt.ion() 
#plt.draw()                                                                         
plt.show(block=True)
#plt.show()
</code></pre>

<p><strong>EDIT:</strong> Ok maybe I could solve this problem with the following approach:
Is it possible to get the ax of a figure that was opened by an other excetion of of program ?</p>

<p><code>plt.show(block=True)</code> should work.</p>

<p>Other hack would be using pause function as shown below:</p>

<pre><code>from matplotlib import pylab
pylab.plot(range(10), range(10))
pylab.pause(2**31-1)
</code></pre>

python python-2.7 matplotlib