Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from ase.visualize.plot import animate
4def write_animation(filename, images, writer=None,
5 interval=200, save_count=100,
6 save_parameters=None, ax=None, **kwargs):
7 import matplotlib.pyplot as plt
9 if save_parameters is None:
10 save_parameters = {}
12 if ax is None:
13 ax = plt.gca()
15 animation = animate(images, ax=ax,
16 interval=interval, save_count=save_count,
17 **kwargs)
18 animation.save(filename, writer=writer,
19 **save_parameters)
22# Shortcuts for ase.io.formats (guessing file type from extension):
23write_gif = write_animation
24write_mp4 = write_animation