Hi Marco,
I was experimenting with vtkplotter.dolfin.plot in Jupyter notebook. I am noticing some unusual behavior between my local machine and a docker container that I built on binder.
A sample notebook with the container.
I was having trouble in making embedded inline plots using jupyter (+dolfin). A simple example like
from dolfin import UnitCubeMesh
from vtkplotter.dolfin import plot
plot(UnitCubeMesh(2,2,2))
would render the plot in a separate window, but on the container it would spit out the error
ModuleNotFoundError: No module named 'vtkOpenGLKitPython'
libgl1-mesa-glx for rendering graphicsFollowing this I simply installed libgl1-mesa-glx libsm6 using
apt-get install libgl1-mesa-glx libsm6
on both my local machine and the container. Now everything works perfectly fine on the container, but I do not get any plot on my machine (neither embedded nor in a separate window). Would you happen to know the issue ?
Also attached is the notebook's output.pdf on my machine. Note that everything works smoothly when running a python script on the terminal, namely:
from dolfin import UnitCubeMesh, Function, FunctionSpace
from vtkplotter.dolfin import plot
import numpy as np
msh = UnitCubeMesh(4,4,4)
V = FunctionSpace(msh, "CG", 1)
w = Function(V)
w.vector()[:] = np.linspace(0,1,V.dim())
plot(w)
runs absolutely fine on the machine.
Hi Bhavesh,
try to update:
pip install -U git+https://github.com/marcomusy/vtkplotter.git
just to make sure we are on the same page.
Your first script in your link works as i expect:

In general you need to set
embedWindow(False) to make the vtk rendering window to pop up externally.
In jupyter session the default is embedWindow('k3d').
other options are 'panel' and 'itkwidgets'.
I do not get any plot on my machine (neither embedded nor in a separate window). Would you happen to know the issue ?
I'm not familiar with libgl1-mesa-glx and don't know exactly what it implies.. maybe you can find some help from this thread https://github.com/marcomusy/vtkplotter/issues/88 ?
Hi Marco,
Thanks for your prompt response. A quick update: so regarding
pip install -U git+https://github.com/marcomusy/vtkplotter.git
just to make sure we are on the same page.
I pip-installed vtkplotter-2020.2.5. Now
embedWindow(False)
vplot(w)
rendr1 = settings.plotter_instance.actors[0]
show(rendr1, newPlotter=True)
works and I can see the plot in a separate window, but switching back to `embedWindow("k3d") namely
embedWindow("k3d")
vplot(w)
rendr1 = settings.plotter_instance.actors[0]
show(rendr1, newPlotter=True)
doesn't render anything in the cell output.
Update: After installing panel and using embedWindow("panel") does render the plot in the output. However the colorbar is missing. I will play around with this in the meantime. Thanks again!
OK! then it's something related to k3d i guess.. it's weird though..
maybe with 'itkwidgets' you get the scalarbar?
I thought so too. Will try to do a fresh install of k3d and try again. panel is only one working so far without the scalarbar. Setting embedWindow("itkwidgets") doesn't work either an simply returns
Viewer(cmap='jet', geometries=[{'vtkClass': 'vtkPolyData', 'points': {'vtkClass': 'vtkPoints', 'name': '_point…
I see.. unfortunately the rendering part in jupyter is delegated to other applications so it not under control of the vtk library and has a lot of limitations..
Thanks for reporting these issues.
Thanks Marco. I think this is (partially) resolved at least to the extent of not being related to vtkplotter.