1

I am using PyVista on Jupyter notebook (in Anaconda in Windows) and using the Panel library but no result is displayed but the code ran fine.

import flopy as fl
import numpy as np
import matplotlib as mplt
import geopandas as gpd
import shapely
import pyproj
import fiona
import pyvista
import panel as pn
import vtk

from pyvista import demos
demos.plot_logo(background='White', jupyter_backend='panel')

The output is not displaying

Can you help me ?

Good evening.

1 Answers1

0

Try jupyter_backend='ipykernel'

Here's an example I tried on jupyter notebook:

import pyvista as pv
from pyvista import examples
# download an example and display it using physically based rendering 
mesh = examples.download_lucy()
mesh.plot(jupyter_backend='ipykernel', interactive=True) 

Although the plot isn't interactive, still don't know how to fix it.

UPDATE:

I used panel instead of ipykernel and now I can interact with the plot in jupyter notebook.

Mohamed Nedal
  • 43
  • 3
  • 12
  • I'm confused. You seem to say in your update that `jupyter_backend='panel'` is what fixed yours? But OP had that `jupyter_backend='panel'`? Plus your example is not the method they are posting about? – Wayne Oct 13 '22 at 21:10
  • Both kernels work for me, but I found that the kernel ipykernel produce non-interactive plots, while the kernel panel produce interactive plots (after running this line first %matplotlib notebook) – Mohamed Nedal Oct 14 '22 at 13:04