animation在Python中不起作用

在Python中如何绘制animationgraphics的正常解释在哪里?

我写了这个

from pylab import * import time ion() tstart = time.time() # for profiling x = arange(0,2*pi,0.01) # x-array line, = plot(x,sin(x)) for i in arange(1,200000): line.set_ydata(sin(x+i/10.0)) # update the data draw() # redraw the canvas print('FPS:', 200/(time.time()-tstart)) 

只有白色的窗户

在这里输入图像说明

尝试:

 from pylab import * import time ion() tstart = time.time() # for profiling x = arange(0,2*pi,0.01) # x-array line, = plot(x,sin(x)) for i in arange(1,200000): line.set_ydata(sin(x+i/10.0)) # update the data draw() # redraw the canvas pause(0.5) 

pause时间在秒