vtkplotter.dolfin.plot not working as usual
See original GitHub issueHi 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.
Initial problem on 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'
Try Installing MESA: namely libgl1-mesa-glx
for rendering graphics
Following 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Thanks Marco. I think this is (partially) resolved at least to the extent of not being related to vtkplotter.
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.