MatPlotLib's ion() and draw() not working
<p>I am trying to plot figures in real time using a for loop. I have the following simple code:</p>

<pre><code>import matplotlib.pyplot as plt

plt.ion()
plt.figure()
for i in range(100):
    plt.plot([i], [i], 'o')
    plt.draw()
    plt.pause(0.0001)
</code></pre>

<p>This code does not show the figure until it has finished computing, which I don't want. I want it to draw the figure after every loop. If I replace <code>plt.draw()</code> with <code>plt.show</code>, multiple figures are output in real time, but I want them all to appear in the same figure. Any ideas?</p>

<p>EDIT:<br>
I downloaded PyCharm with Anaconda and everything works fine. I guess it's a problem with Spyder since I tried a few different versions of it without success. If anyone has any clue what is causing this problem in Spyder, let me know!</p>