It happens when I run this as a script from anaconda prompt
import time
import matplotlib.pyplot as plt
plt.ion()
plt.plot([1,4,2])
plt.draw()
plt.pause(0.01)
time.sleep(0.1)
h = 0
for n in range(0,9500):
h += 1
print(h)
time.sleep(2)
But if I run this code line by line in command window
>>>import matplotlib.pyplot as plt
>>>plt.ion()
>>>plt.plot([1,4,2])
>>>#window is responding and I can do anything I want here
Why is this happening? I want to be able to see the plot while it's computing.