为了更好的表示物理过程,比如波,我们需要画出随时间变化的图像,这时就需要引用from matplotlib.animation中的FuncAnimation函数
函数解析
matplotlib.animation.FuncAnimation(fig, func, frames=None, \
init_func=None, fargs=None, save_count=None, *, cache_frame_data=True, **kwargs)
The figure object that is used to get draw, resize, and any other needed events.funccallable
The function to call at each frame. The first argument will be the next value in frames. Any additional positional arguments can be supplied via the fargs parameter.
The required signature is:
def func(frame, *fargs) -> iterable_of_artists
If blit == True, func must return an iterable of all artists that were modified or created. This information is used by the blitting algorithm to determine which parts of the figure have to be updated. The return value is unused if blit == False and may be omitted in that