plotmne-python

Plot trials of eeg data in mne python


Im new to MNE and EEG in general.

I have data consisting of many epochs from one channel. I would like to plot a graph of the average and std throughout time across the epochs. I can do this with plt, but I thought there should be something that does it in MNE, and I'm unable to find it. Can anyone pls help?

In addition, what is the best way to plot all epochs in one graph, preferably each epoch in a different color?

Thanks!


Solution

  • welcome to mne-python :)
    You can compute and visualise the evoked potential in the following way (assuming you have read the data into epochs variable):

        # compute the evoked potential
        erp = epochs.average()
        # you can also baseline correct the data:
        erp.apply_baseline()
        
        # visualize
        erp.plot_joint()
    

    To plot epochs just use the .plot() method:

        epochs.plot()
    

    Make sure to see the many rich tutorials and examples in mne docs. If you have any further problems we use Discourse now: https://mne.discourse.group/