Unit cellΒΆ

This example shows how to display the unit cell with matplotlib.

from abipy.abilab import abiopen
import abipy.data as abidata

Extract structure from the netcdf file:

with abiopen(abidata.ref_file("sio2_kpath_GSR.nc")) as gsr:
    structure = gsr.structure

To visualize the structure with matplotlib, use:

structure.plot(color_scheme="Jmol")
Si3 O6

Out:

<Figure size 640x480 with 1 Axes>

To wrap sites into first unit cell, use:

# sphinx_gallery_thumbnail_number = 2
structure.plot(to_unit_cell=True)
Si3 O6

Out:

<Figure size 640x480 with 1 Axes>

Total running time of the script: ( 0 minutes 0.258 seconds)

Gallery generated by Sphinx-Gallery