atomlib.visualize
Visualization of atomic structures. Useful for debugging.
AtomImage
AtomImageMpl
Source code in atomlib/visualize/__init__.py
save
save(f: FileOrPath)
show_atoms_3d
show_atoms_3d(
atoms: HasAtoms,
*,
zone: Optional[VecLike] = None,
plane: Optional[VecLike] = None,
backend: BackendName = "mpl",
style: AtomStyle = "small",
**kwargs: Any
) -> AtomImage
Show atoms
on a 3D plot, using backend backend
(defaults to matplotlib).
Source code in atomlib/visualize/__init__.py
show_atoms_2d
show_atoms_2d(
atoms: HasAtoms,
*,
zone: Optional[VecLike] = None,
plane: Optional[VecLike] = None,
horz: Optional[VecLike] = None,
backend: BackendName = "mpl",
style: AtomStyle = "small",
**kwargs: Any
) -> AtomImage
Show atoms
on a 2D plot, using backend backend
(defaults to matplotlib).
Source code in atomlib/visualize/__init__.py
get_elem_color
get_zone
get_zone(
atoms: HasAtoms,
zone: Optional[VecLike] = None,
plane: Optional[VecLike] = None,
default: Optional[VecLike] = None,
) -> NDArray[float64]
Get the zone axis corresponding to the arguments zone
, plane
, and default
.
Source code in atomlib/visualize/__init__.py
get_plot_radii
get_plot_radii(
atoms: HasAtoms,
min_r: Optional[float] = 1.0,
style: AtomStyle = "small",
) -> NDArray[float64]
Get the radii to use for each atom in atoms
.
Source code in atomlib/visualize/__init__.py
get_azim_elev
Get the azimuth and elevation corresponding to the zone zone
.
Source code in atomlib/visualize/__init__.py
show_atoms_mpl_3d
show_atoms_mpl_3d(
atoms: HasAtoms,
*,
fig: Optional[Figure] = None,
zone: Optional[VecLike] = None,
plane: Optional[VecLike] = None,
min_r: Optional[float] = 1.0,
style: AtomStyle = "small"
) -> AtomImageMpl
Show atoms
on a 3D plot using matplotlib.
Source code in atomlib/visualize/__init__.py
show_atoms_mpl_2d
show_atoms_mpl_2d(
atoms: HasAtoms,
*,
fig: Optional[Figure] = None,
zone: Optional[VecLike] = None,
plane: Optional[VecLike] = None,
horz: Optional[VecLike] = None,
min_r: Optional[float] = 1.0,
style: AtomStyle = "small"
) -> AtomImageMpl
Show atoms
on a 2D plot using matplotlib.