# issues with stc.plot

**URL:** <https://mne.discourse.group/t/issues-with-stc-plot/2107>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [March 10, 2020, 12:06pm UTC](https://mne.discourse.group/t/issues-with-stc-plot/2107 "2020-03-10T12:06:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 10, 2020, 12:06pm UTC](https://mne.discourse.group/t/issues-with-stc-plot/2107/1 "2020-03-10T12:06:59Z")

</div>

External Email - Use Caution

Hello,  
I am running Python 3.7.6 and mnedev version 0.20.dev0 on a Windows 10 Pro. Every time I plot the stc, I get to visualise the plot and I can use the interactive time viewer functionality. However, after checking the plot and closing it, I cannot proceed running the other lines of code as everything is frozen and it appears that the software is still running that command. The only thing I can do is to terminate the iPython (version 7.11.1) session and start a new one.  
Here are the lines of code I use to plot stc.

surfer\_kwargs = dict(hemi='split', subjects\_dir=subjects\_dir, views='lateral',initial\_time=0.1, time\_unit='s', size=(800, 400), smoothing\_steps=5, background='b')

brain = stc.plot(\*\*surfer\_kwargs, time\_viewer=True)

Any idea on what might be causing the issue?

Many thanks,  
Federica  
[University of Central Lancashire]  
Please consider the environment before printing  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200310/8de5f57a/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200310/8de5f57a/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 10, 2020, 7:40pm UTC](https://mne.discourse.group/t/issues-with-stc-plot/2107/2 "2020-03-10T19:40:01Z")

</div>

External Email - Use Caution

Can you try running it in IPython and seeing if `%gui qt` helps? If you hit  
Ctrl-C while it's stuck do you get any traceback? You can also try  
upgrading traits, traitsui, pyface, mayavi, and PySurfer to see if any of  
these helps.

You can also try the new PyVista-based visualization and time viewer  
interface with something like:

with mne.viz.use\_3d\_backend('pyvista'):  
&nbsp;&nbsp;&nbsp;&nbsp;stc.plot(\*\*surfer\_kwargs, time\_viewer=True)

This mode/backend is being actively developed but hopefully would be usable  
for you. You'll need to `pip install pyvista` or so to try it.

Eric

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 16, 2020, 3:59pm UTC](https://mne.discourse.group/t/issues-with-stc-plot/2107/3 "2020-03-16T15:59:10Z")

</div>

External Email - Use Caution

Hello,  
Did this issue got resolved or is there any workaround?  
I have once heard that this might be the bug with the GUI and that there is  
no known workaround...  
I also have the similar issue!  
Thank you in advance.  
Sincerely yours,  
Kirill

??, 10 ???. 2020 ?. ? 15:08, Federica Degno \<FDegno at uclan.ac.uk\>:

> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution
> 
> Hello,
> 
> I am running Python 3.7.6 and mnedev version 0.20.dev0 on a Windows 10  
> Pro. Every time I plot the stc, I get to visualise the plot and I can use  
> the interactive time viewer functionality. However, after checking the plot  
> and closing it, I cannot proceed running the other lines of code as  
> everything is frozen and it appears that the software is still running that  
> command. The only thing I can do is to terminate the iPython (version  
> 7.11.1) session and start a new one.
> 
> Here are the lines of code I use to plot stc.
> 
> surfer\_kwargs = dict(hemi='split', subjects\_dir=subjects\_dir,  
> views='lateral',initial\_time=0.1, time\_unit='s', size=(800, 400),  
> smoothing\_steps=5, background='b')
> 
> brain = stc.plot(\*\*surfer\_kwargs, time\_viewer=True)
> 
> Any idea on what might be causing the issue?
> 
> Many thanks,
> 
> Federica  
> [image: University of Central Lancashire] Please consider the environment  
> before printing  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200316/30d21194/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200316/30d21194/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 16, 2020, 7:47pm UTC](https://mne.discourse.group/t/issues-with-stc-plot/2107/4 "2020-03-16T19:47:20Z")

</div>

External Email - Use Caution

One possible culprit is the iPython GUI backend. Try running the line  
%gui qt  
at the beginning of the iPython session or notebook, before you do any plotting.

-- dan  
Daniel McCloy  
[https://dan.mccloy.info](https://dan.mccloy.info)  
Research Scientist  
Institute for Learning and Brain Sciences  
University of Washington

??? Original Message ???
