def play(self, timerange):
"""play an animation
Strongly recommend not stepping though each timesteps; use some skips!
:param timerange: range generator of time steps to animate
"""
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig = plt.figure()
plt.pcolormesh(self.lat, self.axial, self.arfidata[:, :, 0])
plt.axes().set_aspect('equal')
plt.gca().invert_yaxis()
plt.xlabel('Lateral (mm)')
plt.ylabel('Axial (mm)')
anim = animation.FuncAnimation(fig, self.animate, frames=timerange,
blit=False)
plt.show()
评论列表
文章目录