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.

error when trying to use pyvista to plot stc

See original GitHub issue

I am trying to use the new pyvista-plotting for stc (through spyder), on my own data, and this mne-example

When I do not specify a backend, it uses majavi. I tried: mne.viz.set_3d_backend('pyvista')

Output of stc.plot:

File “/home/sh254795/anaconda3/lib/python3.7/site-packages/mne/viz/_brain/_brain.py”, line 201, in init shape=(n_row, n_col), fig=figure)

File “/home/sh254795/anaconda3/lib/python3.7/site-packages/mne/viz/backends/_pyvista.py”, line 141, in init self.plotter.disable_depth_peeling()

AttributeError: ‘Plotter’ object has no attribute ‘disable_depth_peeling’

Output of python -c "import mne; mne.sys_info()":

mne: 0.20.dev0 numpy: 1.17.2 {blas=mkl_rt, lapack=mkl_rt} scipy: 1.3.1 matplotlib: 3.1.1 {backend=Qt5Agg}

sklearn: 0.21.3 numba: 0.45.1 nibabel: 2.5.1 cupy: Not found pandas: 0.25.1 dipy: 1.0.0 mayavi: 4.7.1 {qt_api=pyqt5, PyQt5=5.9.2} pyvista: 0.22.4 vtk: 8.1.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
GuillaumeFaveliercommented, Jan 22, 2020

I’ll work on a patch right now 👍 . But basically, the plotter has a simple routine to detect a notebook environment and it seems that it didn’t work properly in your case. The plotter should behave properly in a regular ipython console for some reason it’s not the case in Spyder, thanks for reporting.

1reaction
SophieHerbstcommented, Jan 22, 2020

Ok thanks! No more error, but the plot appears in the spyder console and I cannot get it out, i.e. use interactive mode. All the usual setting preferences for ipython console graphics or %matplotlib qt does not help. Any ideas?

Read more comments on GitHub >

github_iconTop Results From Across the Web

pyvistaqt 3d backend - plot not interactive - MNE Forum
Hello,. I encountered an issue while trying to plot source localization. Here is a snippet of the code I'm using. import os import...
Read more >
mne.VolSourceEstimate — MNE 1.2.2 documentation
When plotting a standard SourceEstimate (not volume, mixed, or vector) and using the PyVista backend, views='flat' is also supported to plot ...
Read more >
[Mne_analysis] issues with stc.plot
External Email - Use Caution Can you try running it in IPython and seeing if `%gui qt` helps? If you hit Ctrl-C while...
Read more >
Load and Plot from a File — PyVista 0.37.0 documentation
Read a dataset from a known file type. Loading a mesh is trivial - if your data is in one of the many...
Read more >
Package List — Spack 0.20.0.dev0 documentation
This is a list of things you can install using Spack. ... Rather than try to climb an ever-growing mountain, ACPID now lets...
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