mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.72k stars 1.32k forks source link

improve ica.plot_overlay for raw instances #11061

Open vferat opened 2 years ago

vferat commented 2 years ago

Describe the new feature or enhancement

Currently when providing inst=raw, ica.plot_overlay transform it to an evoked for display. This doesn't really make sense when working with spontaneous data. I would be great to be able to plot the overlay on the classic raw.plot() window. Each data channel would be represented by two superimposed traces of different colors: one representing the raw instance and the other the raw instance without the ICA components. It would be useful as in this example, where we users are forced to manually apply ICA to a copy of the raw instance and then plot the 2 raw instances.

Describe your proposed implementation

Directly change the behavior ofica.plot_overlay(insta=raw) or create something like joint_plot(raw1, raw2) which allows to plot several raw instances with same info on the same plot.

Describe possible alternatives

A way to synchronize two raw.plot() windows, which allows to have always the same time window of the recordings in view.

Additional comments

This feature could also be implemented inmne-qt-browser

larsoner commented 2 years ago

I agree this would be useful. From an implementation standpoint it seems difficult, though, since our raw plotting is based on working with a single instance.