The following code
plt.figure(1)
plt.subplot(211) 
plt.axis([0,100, 95, 4000])  
plt.plot(array1,array2,'r')
plt.ylabel("label")
plt.xlabel("label")
plt.subplot(212)
plt.specgram(array3)
plt.show() 
creates two nice diagrams. But how do you update its content without having to close the window?
I would need to create the window in one thread and, while a variable is being updated in the main code, the window is being updated using the variable.
How would you do it?