Visualise¶
- load_atoms.view(atoms: Atoms, show_bonds: bool = False, start_rotation: bool | None = None)[source]¶
Generate an interactive visualisation of an
ase.Atoms
object.- Parameters:
atoms – The atoms object to visualise.
show_bonds – Whether to show bonds between atoms.
start_rotation – Whether to start the visualisation rotating. If
None
, the default is to start rotating if there are fewer than 400 atoms.
Example
Visualise an ethanol molecule in a Jupyter notebook:
Save the visualisation to an
html
file:from pathlib import Path viz = view(ethanol, show_bonds=True) Path("ethanol.html").write_text(viz.data)