Code cannot stop running after closing the interactive window
After I use show(), an interactive window pops up, which is exactly what I want. However, after I manually close this window, the code continues running.
There is my code:
from neuromaps.datasets import fetch_fslr
from surfplot import Plot
from brainspace.plotting.base import Plotter
surfaces = fetch_fslr(data_dir=r"E:\vscode\git_repositories\Plot_figure\neuromaps-data")
lh, rh = surfaces['veryinflated']
p = Plot(lh, rh)
p.show(embed_nb=False, interactive=True, transparent_bg=False, scale=(1,1))
I can only terminate it by restarting my Jupyter notebook, which is quite annoying. (`へ´)
by the way:
python 3.11.9
surfplot==0.2.0
pyvista==0.43.3
Thanks for opening this issue! This is pretty bizarre, does it happen when you set interactive=False?
when I set interactive=False and not change anything else, the popuped windows cannot interactive (it just a static picture). And when I colse the window, the code still hasn't terminated. And I must restart my Jupyter notebook.
I can re-create this issue, I'll have to dig deeper into the cause of it and it could be a Brainspace-related/vtk issue. Thanks for raising this.
Surfplot isn't really intended to provide an interactive viewer, but rather to create a high-quality surface plot in matplolib for publication. If full interactivity is desired, I'd recommend using Connectome Workbench. Once you know the views you wish to visualize the data, you can always use surfplot and adjust the views argument. Perhaps at some point interactivity can be improved.
In terms of static plotting, the options are a) use the p.build() to generate a static matplotlib figure, or b) switch the embed_nb=True if your use-case requires the use of p.show().