mne.viz.plot_epochs_psd_topomap#

mne.viz.plot_epochs_psd_topomap(epochs, bands=None, tmin=None, tmax=None, proj=False, bandwidth=None, adaptive=False, low_bias=True, normalization='length', ch_type=None, cmap=None, agg_fun=None, dB=False, n_jobs=1, normalize=False, cbar_fmt='auto', outlines='head', axes=None, show=True, sphere=None, vlim=(None, None), verbose=None)[source]#

Plot the topomap of the power spectral density across epochs.

Parameters
epochsinstance of Epochs

The epochs object.

bandslist of tuple | None

The frequencies or frequency ranges to plot. Length-2 tuples specify a single frequency and a subplot title (e.g., (6.5, 'presentation rate')); length-3 tuples specify lower and upper band edges and a subplot title. If None (the default), expands to:

bands = [(0, 4, 'Delta'), (4, 8, 'Theta'), (8, 12, 'Alpha'),
         (12, 30, 'Beta'), (30, 45, 'Gamma')]

In bands where a single frequency is provided, the topomap will reflect the single frequency bin that is closest to the provided value.

tminfloat | None

Start time to consider.

tmaxfloat | None

End time to consider.

projbool

Apply projection.

bandwidthfloat

The bandwidth of the multi taper windowing function in Hz. The default value is a window half-bandwidth of 4 Hz.

adaptivebool

Use adaptive weights to combine the tapered spectra into PSD (slow, use n_jobs >> 1 to speed up computation).

low_biasbool

Only use tapers with more than 90% spectral concentration within bandwidth.

normalization‘full’ | ‘length’

Normalization strategy. If “full”, the PSD will be normalized by the sampling rate as well as the length of the signal (as in Nitime). Default is 'length'.

ch_type‘mag’ | ‘grad’ | ‘planar1’ | ‘planar2’ | ‘eeg’ | None

The channel type to plot. For ‘grad’, the gradiometers are collected in pairs and the mean for each pair is plotted. If None, then first available channel type from order given above is used. Defaults to None.

cmapmatplotlib colormap | (colormap, bool) | ‘interactive’ | None

Colormap to use. 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 range. Up and down arrows can be used to change the colormap. If None, 'Reds' is used for data that is either all-positive or all-negative, and 'RdBu_r' is used otherwise. 'interactive' is equivalent to (None, True). Defaults to None.

agg_funcallable()

The function used to aggregate over frequencies. Defaults to numpy.sum() if normalize=True, else numpy.mean().

dBbool

If True, transform data to decibels (with 10 * np.log10(data)) following the application of agg_fun. Ignored if normalize=True.

n_jobsint

The number of jobs to run in parallel (default 1). If -1, it is set to the number of CPU cores. Requires the joblib package.

normalizebool

If True, each band will be divided by the total power. Defaults to False.

cbar_fmtstr

Format string for the colorbar tick labels. If 'auto', is equivalent to ‘%0.3f’ if dB=False and ‘%0.1f’ if dB=True. Defaults to 'auto'.

outlines‘head’ | ‘skirt’ | dict | None

The outlines to be drawn. If ‘head’, the default head scheme will be drawn. If ‘skirt’ the head scheme will be drawn, but sensors are allowed to be plotted outside of the head circle. If dict, each key refers to a tuple of x and y positions, the values in ‘mask_pos’ will serve as image mask. Alternatively, a matplotlib patch object can be passed for advanced masking options, either directly or as a function that returns patches (required for multi-axis plots). If None, nothing will be drawn. Defaults to ‘head’.

axeslist of Axes | None

List of axes to plot consecutive topographies to. If None the axes will be created automatically. Defaults to None.

showbool

Show figure if True.

spherefloat | array-like | str | None

The sphere parameters to use for the cartoon head. Can be array-like of shape (4,) to give the X/Y/Z origin and radius in meters, or a single float to give the radius (origin assumed 0, 0, 0). Can also be a spherical ConductorModel, which will use the origin and radius. Can be “auto” to use a digitization-based fit. Can also be None (default) to use ‘auto’ when enough extra digitization points are available, and 0.095 otherwise. Currently the head radius does not affect plotting.

New in version 0.20.

vlimtuple of length 2 | ‘joint’

Colormap limits to use. If a tuple of floats, specifies the lower and upper bounds of the colormap (in that order); providing None for either entry will set the corresponding boundary at the min/max of the data (separately for each topomap). Elements of the tuple may also be callable functions which take in a NumPy array and return a scalar. If vlim='joint', will compute the colormap limits jointly across all topomaps of the same channel type, using the min/max of the data. Defaults to (None, None).

New in version 0.21.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns
figinstance of Figure

Figure distributing one image per channel across sensor topography.