render.py 文件源码

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

项目:TikZ 作者: ellisk42 项目源码 文件源码
def animateMatrices(matrices,outputFilename = None):
    fig = plot.figure() # make figure
    im = plot.imshow(matrices[0], cmap=plot.get_cmap('bone'), vmin=0.0, vmax=1.0)

    # function to update figure
    def updatefig(j):
        # set the data in the axesimage object
        im.set_array(matrices[j])
        # return the artists set
        return im,
    # kick off the animation
    ani = animation.FuncAnimation(fig, updatefig, frames=range(len(matrices)), 
                              interval=50, blit=True)
    if outputFilename != None:
        ani.save(outputFilename, dpi = 80,writer = 'imagemagick')
    plot.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号