pythonplotmne-python

How do I scroll through EEG data using the MNE package?


I'm learning the basics of the MNE package for EEG analysis. I'm able to load my data (.edf format) and perform various operations. However, a plot feature described at

https://mne.tools/stable/auto_tutorials/raw/plot_40_visualize_raw.html#interactive-data-browsing-with-raw-plot

indicates I should be able to scroll through the data.

Here's my code:

 import mne as mn
 raw = mn.io.read_raw_edf("patient_019.edf",preload=True)
 raw.plot();

The data is a 10-minute recording from 46 channels and the result shows the default 20 channels and first 10 seconds. There is a HELP button in the lower-left corner of the window, but's inactive.

I've tried the keyboard shortcuts at the above help URL, but none of them work. Is there an additional package I need in order to scroll through the graphs? I'm doing this in a Jupyter notebook, Python 3, Mac OS Catalina.

EEG graph imported using MNE


Solution

  • Putting this before plotting does the trick:

    %matplotlib qt