- mne.viz.plot_epochs_image(epochs, picks=None, sigma=0.0, vmin=None, vmax=None, colorbar=True, order=None, show=True, units=None, scalings=None, cmap=None, fig=None, axes=None, overlay_times=None, combine=None, group_by=None, evoked=True, ts_args=None, title=None, clear=False)#
Plot Event Related Potential / Fields image.
- epochsinstance of
str| array_like |
Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g.,
['meg', 'eeg']) will pick channels of those types, channel name strings (e.g.,
['MEG0111', 'MEG2623']will pick the given channels. Can also be the string values “all” to pick all channels, or “data” to pick data channels. None (default) will pick good data channels. Note that channels in
info['bads']will be included if their names or indices are explicitly provided.
combineto determine the number of figures generated; see Notes.
The standard deviation of a Gaussian smoothing window applied along the epochs axis of the image. If 0, no smoothing is applied. Defaults to 0.
The min value in the image (and the ER[P/F]). The unit is µV for EEG channels, fT for magnetometers and fT/cm for gradiometers. If vmin is None and multiple plots are returned, the limit is equalized within channel types. Hint: to specify the lower limit of the data, use
vmin=lambda data: data.min().
The max value in the image (and the ER[P/F]). The unit is µV for EEG channels, fT for magnetometers and fT/cm for gradiometers. If vmin is None and multiple plots are returned, the limit is equalized within channel types.
Display or not a colorbar.
None, order is used to reorder the epochs along the y-axis of the image. If it is an array of
int, its length should match the number of good epochs. If it is a callable it should accept two positional parameters (
data.shape == (len(good_epochs), len(times))) and return an
arrayof indices that will sort
dataalong its first axis.
Show figure if True.
The units of the channel types used for axes labels. If None, defaults to
units=dict(eeg='µV', grad='fT/cm', mag='fT').
The scalings of the channel types to be applied for plotting. If None, defaults to
scalings=dict(eeg=1e6, grad=1e13, mag=1e15, eog=1e6).
None| colormap | (colormap, bool) | ‘interactive’
Colormap. If tuple, the first value indicates the colormap to use and the second value is a boolean defining interactivity. In interactive mode the colors are adjustable by clicking and dragging the colorbar with left and right mouse button. Left mouse button moves the scale up and down and right mouse button adjusts the range. Hitting space bar resets the scale. Up and down arrows can be used to change the colormap. If ‘interactive’, translates to (‘RdBu_r’, True). If None, “RdBu_r” is used, unless the data is all positive, in which case “Reds” is used.
Figureinstance to draw the image to. Figure must contain the correct number of axes for drawing the epochs image, the evoked response, and a colorbar (depending on values of
Nonea new figure is created. Defaults to
Axesobjects in which to draw the image, evoked response, and colorbar (in that order). Length of list must be 1, 2, or 3 (depending on values of
evokedparameters). If a
dict, each entry must be a list of Axes objects with the same constraints as above. If both
group_byare dicts, their keys must match. Providing non-
Nonevalues for both
axesresults in an error. Defaults to
- overlay_timesarray_like, shape (n_epochs,) |
Times (in seconds) at which to draw a line on the corresponding row of the image (e.g., a reaction time associated with each epoch). Note that
overlay_timesshould be ordered to correspond with the
How to combine information across channels. If a
str, must be one of ‘mean’, ‘median’, ‘std’ (standard deviation) or ‘gfp’ (global field power). If callable, the callable must accept one positional input (data of shape
(n_epochs, n_channels, n_times)) and return an
(n_epochs, n_times). For example:
combine = lambda data: np.median(data, axis=1)
None, channels are combined by computing GFP, unless
picksis a list of specific channels (not channel types), in which case no combining is performed and each channel gets its own figure. See Notes for further details. Defaults to
Specifies which channels are aggregated into a single figure, with aggregation method determined by the
combineparameter. If not
Figureis made per dict entry; the dict key will be used as the figure title and the dict values must be lists of picks (either channel names or integer indices of
epochs.ch_names). For example:
group_by=dict(Left_ROI=[1, 2, 3, 4], Right_ROI=[5, 6, 7, 8])
Note that within a dict entry all channels must have the same type.
combineto determine the number of figures generated; see Notes. Defaults to
Draw the ER[P/F] below the image or not.
str, will be plotted as figure title. Otherwise, the title will indicate channel(s) or channel type being plotted. Defaults to
Whether to clear the axes before plotting (if
axesare provided). Defaults to
- epochsinstance of
You can control how channels are aggregated into one figure or plotted in separate figures through a combination of the
dict, the result is one
Figureper dictionary key (for any valid values of
None, the number and content of the figures generated depends on the values of
combine, as summarized in this table:
None, int, list of int, ch_name, list of ch_names, ch_type, list of ch_types
None, string, or callable
1 figure per dict key
None, ch_type, list of ch_types
None, string, or callable
1 figure per ch_type
int, ch_name, list of int, list of ch_names
1 figure per pick
string or callable