Issue with mne.viz.plot_compare_evokeds() and mne.grand_average()

Hi,

I am using ‘mne.viz.plot_compare_evokeds()’ to visualize the evoked time courses for multiple conditions. I used mne.preprocessing.compute_current_source_density() to first transform the Epochs and then average the Epochs to get the evoked responses for each condition.

But I could not change the y-axis limits of the plots when I passed the ‘ylim’ parameter to the mne.viz.plot_compare_evokeds() function. It worked well for the non CSD transformed data.

Also, when I used mne.grand_average(), it gave long blocks of warnings consisting of :
NOTE: pick_channels() is a legacy function. New code should use inst.pick(…).

This took too much space in my Jupyter notebook. It didn’t go away when I tried explicitly suppressing the warnings using the python ‘warnings’ module.

Here’s my system info:

  • MNE version: 1.7.0
  • operating system: macOS-12.6
  • Python: 3.11.6

Appreciate any advice and help!

Thanks,
Lizzie

hello

when passing the ylim argument, did you use the “eeg” key, or the “csd” key?

I had the same issue, and just found out thanks to @mscheltienne that I had to put

ylim=dict(csd=[x, y])

2 Likes