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=None, 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 | None

The number of jobs to run in parallel. If -1, it is set to the number of CPU cores. Requires the joblib package. None (default) is a marker for ‘unset’ that will be interpreted as n_jobs=1 (sequential execution) unless the call is performed under a joblib.parallel_backend() context manager that sets another value for n_jobs.

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 | instance of ConductorModel | None | ‘auto’ | ‘eeglab’

The sphere parameters to use for the head outline. Can be array-like of shape (4,) to give the X/Y/Z origin and radius in meters, or a single float to give just the radius (origin assumed 0, 0, 0). Can also be an instance of a spherical ConductorModel to use the origin and radius from that object. If 'auto' the sphere is fit to digitization points. If 'eeglab' the head circle is defined by EEG electrodes 'Fpz', 'Oz', 'T7', and 'T8' (if 'Fpz' is not present, it will be approximated from the coordinates of 'Oz'). None (the default) is equivalent to 'auto' when enough extra digitization points are available, and (0, 0, 0, 0.095) otherwise. Currently the head radius does not affect plotting.

New in version 0.20.

Changed in version 1.1: Added 'eeglab' option.

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.