bemobil_mne.viz.plot_various_ERPs#

bemobil_mne.viz.plot_various_ERPs(inst, *, event_id, picks=None, sfreq=None, subtraction_event=None, subtraction_targets=None, epochs_kwargs=None, plot_kwargs=None)[source]#

Prepare and plot various ERPs from raw EEG or ICA sources.

This function prepares and plots Event-Related Potentials (ERPs) from raw EEG data or ICA sources. It supports both individual and group analyses, allows subtraction of specific events from target events, and can handle multiple raw instances. The function returns a matplotlib Figure with the ERP plots.

Parameters:
instmne.io.Raw | list of mne.io.Raw

Raw EEG or ICA sources, or a list of such instances for group analysis.

event_iddict

Mapping of event descriptions to integers, as found in raw.annotations.

pickslist of str or int, optional

Channel names or indices to include. If None, all channels are used.

sfreqfloat | None, optional

If provided, resample all raws to this sampling frequency.

subtraction_eventstr, optional

Event to subtract from target events. If specified, ERPs of target events will be subtracted by this event.

subtraction_targetslist of str, optional

Events to subtract from. Only used if subtraction_event is specified.

epochs_kwargsdict, optional

Additional keyword arguments for mne.Epochs creation.

plot_kwargsdict, optional

Additional keyword arguments for ERP plotting.

Returns:
figmatplotlib.figure.Figure

The generated ERP figure.

Examples

>>> raw = mne.io.read_raw_fif("subject_raw.fif")
>>> event_id = {"stimulus": 1, "control": 2}
>>> fig = plot_various_ERPs(raw, event_id=event_id)