Is there anyone ever use pymatgen?
When I visit the official site of pymatgen. I saw the quick start tutorial. I think this package is very nice. My question is I want to plot materials structure look likes in this figure.
I got an information from that site, to plot structures
#Visualize a structure. Requires VTK to be installed.
pmg view filename
I've download VTK. But I do not know, how to use it. I could not understand clearly.
Me and my colleages use pymatgen a lot but we add an external package to display pymatgen structures in jupyter notebooks called nglview.
conda install -c conda-forge nglview
to display the structure_to_show (a pymatgen structure object):
import nglview as nv
view = nv.show_pymatgen(structure_to_show)
view.add_unitcell()
view
this can handle very large structures very fast
Please install vtk with python support, depending on your python version on the machine.
For python 3
conda install -c clinicalgraphics vtk
For python 2
conda install -c anaconda vtk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With