Note
Click here to download the full example code
X-ray diffraction patternΒΆ
This example shows how to plot the X-ray diffraction pattern with pymatgen

Out:
/Users/gmatteo/git_repos/pymatgen/pymatgen/util/plotting.py:550: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
plt.show()
from abipy import abilab
import abipy.data as abidata
# Extract the structure (supports multiple formats e.g netcdf, Abinit input, cif, POSCAR)
# Also available via the `abistruct.py xrd FILE` command line interface.
structure = abilab.Structure.from_file(abidata.ref_file("si_scf_WFK.nc"))
import sys
if sys.version[0:3] > '2.7':
# pmg broke py compatibility
structure.plot_xrd()
Total running time of the script: ( 0 minutes 0.251 seconds)