question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vtkplotter.dolfin.plot not working as usual

See original GitHub issue

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.

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:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bhaveshshrimalicommented, Apr 22, 2020

Thanks Marco. I think this is (partially) resolved at least to the extent of not being related to vtkplotter.

1reaction
marcomusycommented, Apr 21, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with plotting a solution of Stokes Problem
Hello everyone, I am having a problem with plotting, as in I am not getting a heat map of the solution of the...
Read more >
Plotting backend is set to vtk even though no vtk is present
In the docker images no vtk is included, but plot still uses VTKPlotter. Two related issues: can the backend fall back to matplotlib...
Read more >
Archived FEniCS QA questions
... problem-with-meshfunction-in-dolfin-1-0-0 ... how-to-plot-mesh-with-corresponding-indices-vertices-edges ... plot-expression-not-correct ...
Read more >
Computation of Eigenmodes in Three-Dimensional Structures
To do this, the eigenvalue problem obtained from the wave equation is expressed in its weak form, ... from vtkplotter.dolfin import plot.
Read more >
Reading and plotting VTK file data structure with python
tl;dr: I don't think you should try to use matplotlib for this, and it would be difficult and not work very well.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found