plot confidence intervals with plot_compare_evoked

Hi

I am attempting to plot confidence intervals for ERPs plotted with plot_compare_evokeds with the following code:


mne.viz.plot_compare_evokeds([Epochs.iter_evoked()], 
                             combine='mean', 
                             ci = .95)

However I get an error:
TypeError: cannot pickle 'generator' object

From my understanding the .iter_evoked function should return 1 evoked object per Epoch, from which mean and CI is then calculated.
What am I misunderstanding?
I tried following recommendations from a previous post:plot_compare_evokeds from mne.EvokedArray: confidence intervals and ylim
however I am still at a loss

  • MNE version: e.g. 0.24.0
  • operating system: Windows 10 /

Did you read the example on EEG processing and Event Related Potentials (ERPs) — MNE 0.24.1 documentation? I think you are not passing the correct object for the first argument, it looks like this is the Epochs constructor, but this should be e.g. a dict of lists of epochs as shown in the example.