vasp-dev / py4vasp

Python interface for VASP
https://vasp.at/py4vasp/latest/
Apache License 2.0
78 stars 20 forks source link

structure plot function not work #143

Open tuheihei opened 9 months ago

tuheihei commented 9 months ago

Hi, When I use the calculation.structure.plot to plot the CONTCAR or POSCAR, it gives out NGLWidget() but not a 3D view of a structure. Any help would be appreciated. Yi

martin-schlipf commented 9 months ago

Do you execute the code in a Jupyter notebook? Visualizing the structure requires a browser window.

tuheihei commented 9 months ago

Do you execute the code in a Jupyter Notebook? Visualizing the structure requires a browser window.

Thanks for the quick follow-up. Yes, the code was run in a Jupyter Notebook on a m1 MacBook. Other functions, including "dos.plot()" and "structure.print()", worked, while that of "structure.plot" malfunctioned, it read "NGLWidget()" or, sometimes, "NGLWidget(max_frame = 499). Any advice would be greatly appreciated.

martin-schlipf commented 9 months ago

Can you try

import nglview
nglview.demo()

to see whether the issue is with NGL or the py4vasp wrapper?

tuheihei commented 9 months ago

Can you try

import nglview
nglview.demo()

to see whether the issue is with NGL or the py4vasp wrapper? It returns"NGLWidget()" The issue indeed seems to be relative to NGL. So what can I do to fix this? Thanks

Screenshot 2024-02-27 at 10 30 24
martin-schlipf commented 9 months ago

Okay, I will suggest a couple of more things you can try but if none of them work, I would suggest to post this in the nglview Github page.