plot_evoked_topomap(evoked, times='auto', ch_type=None, vmin=None, vmax=None, cmap=None, sensors=True, colorbar=True, scalings=None, units=None, res=64, size=1, cbar_fmt='%3.1f', time_unit='s', time_format=None, proj=False, show=True, show_names=False, title=None, mask=None, mask_params=None, outlines='head', contours=6, image_interp='bilinear', average=None, axes=None, extrapolate='auto', sphere=None, border='mean', nrows=1, ncols='auto')¶
Plot topographic maps of specific time points of evoked data.
The Evoked object.
float| “auto” | “peaks” | “interactive”
The time point(s) to plot. If “auto”, the number of
axesdetermines the amount of time point(s). If
axesis also None, at most 10 topographies will be shown with a regular time spacing between the first and last time instant. If “peaks”, finds time points automatically by checking for local maxima in global field power. If “interactive”, the time can be set interactively at run-time by using a slider.
The channel type being plotted. Determines the
New in version 0.21.
- vmin, vmax
Lower and upper bounds of the colormap, in the same units as the data. If
None, they are set at ± the maximum absolute value of the data (yielding a colormap with midpoint at 0). If only one of
None, will use
max(data), respectively. If callable, should accept a
NumPy arrayof data and return a float.
- cmapmatplotlib colormap | (colormap, bool) | ‘interactive’ |
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 (zoom). The mouse scroll can also be used to adjust the range. Hitting space bar resets the range. Up and down arrows can be used to change the colormap. If None (default), ‘Reds’ is used for all positive data, otherwise defaults to ‘RdBu_r’. If ‘interactive’, translates to (None, True).
Interactive mode works smoothly only for a small amount of topomaps. Interactive mode is disabled by default for more than 2 topomaps.
- sensorsbool |
Add markers for sensor locations to the plot. Accepts matplotlib plot format string (e.g., ‘r+’ for red plusses). If True (default), circles will be used.
Plot a colorbar in the rightmost column of the figure.
The scalings of the channel types to be applied for plotting. If None, defaults to
dict(eeg=1e6, grad=1e13, mag=1e15).
The unit of the channel type used for colorbar label. If scale is None the unit is automatically determined.
The resolution of the topomap image (n pixels along each side).
Side length per topomap in inches.
String format for colorbar values.
The units for the time axis, can be “ms” or “s” (default).
New in version 0.16.
String format for topomap values. Defaults (None) to “%01d ms” if
time_unit='ms', “%0.3f s” if
time_unit='s', and “%g” otherwise. Can be an empty string to omit the time label.
- projbool | ‘interactive’ | ‘reconstruct’
If true SSP projections are applied before display. If ‘interactive’, a check box for reversible selection of SSP projection vectors will be shown. If ‘reconstruct’, projection vectors will be applied and then M/EEG data will be reconstructed via field mapping to reduce the signal bias caused by projection.
Changed in version 0.21: Support for ‘reconstruct’ was added.
Show figure if True.
- show_namesbool |
If True, show channel names on top of the map. If a callable is passed, channel names will be formatted using the callable; e.g., to delete the prefix ‘MEG ‘ from all channel names, pass the function
lambda x: x.replace('MEG ', ''). If
maskis not None, only significant sensors will be shown.
Title. If None (default), no title is displayed.
ndarrayof bool, shape (n_channels, n_times) |
The channels to be marked as significant at a given time point. Indices set to
Truewill be considered. Defaults to
Additional plotting parameters for plotting significant sensors. Default (None) equals:
dict(marker='o', markerfacecolor='w', markeredgecolor='k', linewidth=0, markersize=4)
- outlines‘head’ | ‘skirt’ |
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’.
The number of contour lines to draw. If 0, no contours will be drawn. When an integer, matplotlib ticker locator is used to find suitable values for the contour thresholds (may sometimes be inaccurate, use array for accuracy). If an array, the values represent the levels for the contours. The values are in µV for EEG, fT for magnetometers and fT/m for gradiometers. If colorbar=True, the ticks in colorbar correspond to the contour levels. Defaults to 6.
The image interpolation to be used. All matplotlib options are accepted.
The time window around a given time to be used for averaging (seconds). For example, 0.01 would translate into window that starts 5 ms before and ends 5 ms after a given time point. Defaults to None, which means no averaging.
- axesinstance of
The axes to plot to. If list, the list must be a list of Axes of the same length as
timesis None). If instance of Axes,
timesmust be a float or a list of one float. Defaults to None.
Extrapolate to four points placed to form a square encompassing all data points, where each side of the square is three times the range of the data in the respective dimension.
Extrapolate only to nearby points (approximately to points closer than median inter-electrode distance). This will also set the mask to be polygonal based on the convex hull of the sensors.
Extrapolate out to the edges of the clipping circle. This will be on the head circle when the sensors are contained within the head circle, but it can extend beyond the head when sensors are plotted outside the head circle.
Changed in version 0.21:
The default was changed to
'local'was changed to use a convex hull mask
'head'was changed to extrapolate out to the clipping circle.
New in version 0.18.
float| array_like |
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.
Value to extrapolate to on the topomap borders. If
'mean'(default), then each extrapolated point has the average value of its neighbours.
New in version 0.20.
The number of rows of topographies to plot. Defaults to 1. If ‘auto’, obtains the number of rows depending on the amount of times to plot and the number of cols. Not valid when times == ‘interactive’.
New in version 0.20.
The number of columns of topographies to plot. If ‘auto’ (default), obtains the number of columns depending on the amount of times to plot and the number of rows. Not valid when times == ‘interactive’.
New in version 0.20.
- figinstance of
- figinstance of
axesare provided and
colorbar=True, note that the colorbar scale will only accurately reflect topomaps that are generated in the same call as the colorbar. Note also that the colorbar will not be resized automatically when
axesare provided; use matplotlib’s
axes.set_position()method or gridspec interface to adjust the colorbar size yourself.