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:
- inst
mne.io.Raw|listofmne.io.Raw Raw EEG or ICA sources, or a list of such instances for group analysis.
- event_id
dict Mapping of event descriptions to integers, as found in raw.annotations.
- picks
listofstrorint,optional Channel names or indices to include. If None, all channels are used.
- sfreq
float|None,optional If provided, resample all raws to this sampling frequency.
- subtraction_event
str,optional Event to subtract from target events. If specified, ERPs of target events will be subtracted by this event.
- subtraction_targets
listofstr,optional Events to subtract from. Only used if subtraction_event is specified.
- epochs_kwargs
dict,optional Additional keyword arguments for mne.Epochs creation.
- plot_kwargs
dict,optional Additional keyword arguments for ERP plotting.
- inst
- Returns:
- fig
matplotlib.figure.Figure The generated ERP figure.
- fig
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)