Skip to content

stc.plot() closes when run non-interactively #14105

Description

@cbrnr

Running the following snippet non-interactively results in the figure closing almost immediately:

import mne

data_path = mne.datasets.sample.data_path()
stc_fname = data_path / "MEG" / "sample" / "sample_audvis-meg-eeg"
stc = mne.read_source_estimate(stc_fname)
stc.plot("sample", subjects_dir=data_path / "subjects")

Traceback:

Using pyvistaqt 3d backend.
Using control points [ 5.17909658  6.18448887 18.83197989]
Press Enter to close...^CError calling Python override of QWidget::eventFilter(): Traceback (most recent call last):
  File "/Users/clemens/Projects/mne-python/.venv/lib/python3.14/site-packages/matplotlib/backends/backend_qt.py", line 265, in eventFilter
    def eventFilter(self, source, event):
    
KeyboardInterrupt
 source /Users/clemens/Projects/mne-python/.venv/bin/activate

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions