-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interactive PyVista inside a Jupyter Notebook #12
Comments
Actually if I modify def plot_scene_1():
S = pv.Sphere()
plotter = pv.Plotter()
plotter.add_mesh(S)
return plotter.show()
plot_scene_1() So I work on integrating this idea in mne-python. Please don't hesitate to tell me if you know any way to do it better. |
@GuillaumeFavelier: the I expect this behavior... however this might be considered a bug as a user might expect that any call to from pyvista import examples
import pyvista as pv
mesh = examples.download_st_helens().warp_by_scalar()
plotter = pv.Plotter()
plotter.add_mesh(mesh)
output = plotter.show(use_panel=False) Perhaps we need to collaborate with the |
Many thanks for the detailed explanations @banesullivan, now I understand better how it works and I think I can manage with this solution for now. Although I had to rely on the part of code detecting if the script is executed inside a notebook.
That would wonderful of course! |
That's strange, what exactly do you mean? I thought I had the |
And yes, it works as expected. My bad, it was not clear. What I mean is, I had to use a workaround in my specific use case because I expect that any call to |
Actually after some more research I found a way to force panel to show the pane thanks to the So I used the following function: def notebook_show(disp, notebook_url="localhost:8888", port=0):
from panel.viewable import show_server
show_server(disp, notebook_url, port) Do you think there would be a way to integrate such a feature in PyVista @banesullivan ? Eventually, I can open a discussion with the Panel developers to find a better/cleaner solution just in case. |
Probably - we should add something like this in pyvista/pyvista#300. My only hesitation is that the url and port have to be known, and they might not always be Frankly, I think all notebook related dev should be paused until a few things move forward with
Once those two issues are addressed, we will favor using |
After more investigation I found that this version of def plot_scene_1():
from IPython.display import display
S = pv.Sphere()
plotter = pv.Plotter()
plotter.add_mesh(S, color='white')
disp = plotter.show(use_panel=True, auto_close=False)
display(disp)
plot_scene_1() |
I'm currently experimenting with
PyVista
inside ajupyter notebook
and I noticed that the figures required a specific pipeline to be displayed automatically.Do you know a way to see the result of the first scenario
plot_scene_1
?The text was updated successfully, but these errors were encountered: