erlab.plotting.atoms¶
Plot atoms.
Classes and functions for plotting atoms and bonds in a crystal structure using matplotlib’s 3D plotting capabilities.
Some of the projection code was adapted from kwant.
Classes
|
- class erlab.plotting.atoms.CrystalProperty(atom_pos, avec, offset=(0.0, 0.0, 0.0), radii=None, colors=None, repeat=(1, 1, 1), bounds=None, mask=None, r_factor=0.4)[source]¶
Bases:
object- plot(ax=None, scale_bonds=True, scale_atoms=True, clean_axes=True, bond_kw=None, atom_kw=None)[source]¶
Plot the crystal structure.
- Parameters:
ax (
Axes3D|None, default:None) – A 3D axes object to plot the crystal on. If not provided, add_subplot will be called on the current figure.scale_bonds (
bool, default:True) – Whether to scale the bond linewidths based on the distance from the camera, by default Truescale_atoms (
bool, default:True) – Whether to scale the atom sizes based on the distance from the camera, by default Trueclean_axes (
bool, default:True) – Whether to clean the axes by removing the background and grid, setting pane color, and removing the margins, by default Truebond_kw (
dict|None, default:None) – Keyword arguments passed ontoBond3DCollectionatom_kw (
dict|None, default:None) – Keyword arguments passed ontompl_toolkits.mplot3d.Axes3D.scatterused to plot the atoms.