plotting.py 文件源码

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

项目:ml_capstone 作者: drscott173 项目源码 文件源码
def theta_gif(self):
        #
        # Create an animated gif of the contour plot from above by varying theta from 0 to pi
        #
        self.theta = 0
        x,y,z = self.location_contours([0.2, 0.2, 0.2, self.theta])
        self.fig = plt.figure()
        self.im = plt.imshow(z, interpolation='bilinear', origin='lower', cmap=cm.inferno)
        CBI = plt.colorbar(self.im, orientation='horizontal', shrink=0.8)
        plt.xlabel('X %')
        plt.ylabel('Y %')
        ani = animation.FuncAnimation(self.fig, self.update_theta, frames=np.arange(0,20), interval=200, blit=False)
        ani.save('figures/theta.gif', dpi=80, writer='imagemagick')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号