I'm trying to produce a plot in a loop that updates itself every iteration. Working in a linux environment with python 2.6.6 I have it working, but when I run the same code in windows XP with python 2.7.3 it fails. Minimal code that has produced this error for me is:
import matplotlib.pyplot as plt
plt.ion()
plt.figure(1)
for i in range(10):
plt.clf()
plt.plot(i,i**2,'bo')
plt.axis([-1,10, -1, 90])
plt.draw()
In linux I see a blue dot that moves itself along a parabola. In MSwindows I get an empty window to begin with and then a plot with a point at (9,81) appears. This seems pretty straightforward, but maybe I'm missing something small. Any suggestions?
animationlibrary instead matplotlib.org/examples/animation/basic_example.htmlanimationlibrary, but it wasn't really what I was looking for. Maybe I misunderstood its use, but it seemed to collect all the figures during execution, but animate them only once all plots were collected. I was looking for more of a real time data display than an animation at the end of data collection. Thanks for the suggestion though.