I wanted to do something like below:
from matplotlib import pyplot as plt
from time import sleep
plt.ion()
plt.show()
for i in range(10):
plt.plot([1,2,3], [1,2,3]) # dummy data
sleep(2)
plt.cla()
sleep(2)
But this does not work. The window appears, but nothing is drawn in it, and all buttons are dead too.
So I experimented a bit. If I paste the following into a Python shell, it shows the graph as expected.
from matplotlib import pyplot as plt
from time import sleep
plt.ion()
plt.show()
plt.plot([1,2,3], [1,2,3])
#sleep(60)
But if I comment out the last line, the window appears, but empty. I don't see why it behaves like that, can someone explain?