Iām having trouble with MNEās ica.plot_components() function. When I call this function, my program seems to completely hang. Thereās no error message, but thereās also no expected output.
I have tried the following solutions, but the problem persists:
Reducing the number of ICA components
Disabling interactive plotting
Updating MNE and relevant packages to the latest versions
Here are the details of my environment:
Operating System: Windows 10 and win11 (I tried on different devices)
Python Version: (3.9 ; 3.8)
MNE Version: (1.2 ; 1.3)
NumPy Version: (1.24.3)
SciPy Version: (1.10.1)
Matplotlib Version: (-base=3.7.1; -inline=0.1.6)
The data Iām working with is EEG data, and its size is 500mb. Iām wondering if anyone else has encountered a similar problem, or if anyone knows how to solve this issue. Any help would be greatly appreciated.
In contrast to others, I do not recommend to use Jupyter notebooks (you are not the first person to encounter problems with visualizations). In my experience, a plain interactive interpreter session (which includes IPython), works much better for (interactive) data analysis. PyCharm has a very nice integrated Python terminal, please try if this solves your issue.
Please do try out @cbrnr 's suggestion, but just FYI, when I am using MNE visualization functions within a Jupyter notebook, I run %matplotlib qt in a cell before doing any plotting
I think mne.preprocessing.plot_components uses a matplotlib backend so this might solve your issue.
EDIT: FYI I think %matplotlib qt requires that you have the pyqt5 python package installed
thanks for your advice Scott. I have tried matplotlib qt/ inline. It works well while I doing other plot. Only the plot_component encountered the problem.