Coverage for /builds/ase/ase/ase/io/animation.py : 100.00%

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,
6 save_count=None, # ignored for newer matplotlib (2023)
7 save_parameters=None, ax=None, **kwargs):
8 import matplotlib.pyplot as plt
10 if save_parameters is None:
11 save_parameters = {}
13 if ax is None:
14 ax = plt.gca()
16 animation = animate(images, ax=ax,
17 interval=interval,
18 **kwargs)
19 animation.save(filename, writer=writer,
20 **save_parameters)
23# Shortcuts for ase.io.formats (guessing file type from extension):
24write_gif = write_animation
25write_mp4 = write_animation