def sensor_anim(self, theta=0):
#
# Animate the contour plot by changing sensor values and holding
# the angle fixed at theta.
#
self.theta = theta
self.sensor = 0.0
x,y,z = self.location_contours([0,0,0, 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)
ani = animation.FuncAnimation(self.fig, self.update_sensor, interval=50, blit=False)
plt.show()
评论列表
文章目录