In MNE with Python, I would like to keep the interactive plotting window open once the calling def is executed completely.
However, this is not achievable via the following code:
def get_plot():
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file)
raw.plot()
get_plot()
Such that, once the get_plot()
is completed, the plot window is automatically closed.
Also, I am on Windows 10 with PyCharm 2020.1.3.
May I know how to handle this issue?