Exercise14.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:computationalphysics_N2013301020050 作者: ShixingWang 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号