When I use spyder to get a brain class and plot a brain by using Brain, then the PyVista window will show a surface. But , the program will not keep executing when i close the PyVista window . Error rises : ‘NoneType’ object has no attribute 'layout. So I can’t add_annotation to brain.
We are going to need a bit more information. We can not reproduce what you experienced with the code snippet you provide. Also, could you please paste the full traceback and not only the last line?
Thanks for your reply,Mathieu!
I also tried this tutorial,but the surface did’t be anotated. The fig
My 3d backend is “notebook”. Is there any wrong with my spyder preference or other problems?
In the Spyder preferences: IPython console >> Graphics >> Graphics backend. I have this set to Qt5.
For MNE’s backend, let’s try both as I don’t remember which one was working for me and I don’t have the 3D viz dependencies installed on this computer. You can change it with a context manager:
from mne.viz import use_3d_backend
with use_3d_backend("pyvistaqt"):
# tutorial code
If that does not work, I’ll check the exact settings on my laptop on Monday.