def movie(self):
# New figure with white background
fig = plt.figure(figsize=(6,6), facecolor='white')
# New axis over the whole figure, no frame and a 1:1 aspect ratio
ax = fig.add_axes([0,0,1,1], frameon=False, aspect=1)
line, = ax.plot([], [], lw=2)
def init():
line.set_data([], [])
return line,
def animate(i):
x = self.X
y = self.Y[i]
line.set_data(list(x), list(y))
return line,
anim1=animation.FuncAnimation(fig, animate, init_func=init, frames=3000, interval=30)
plt.show()
return 0
Exercise14.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录