Plot evoked data using butterfly plots.
Left click to a line shows the channel name. Selecting an area by clicking and holding left mouse button plots a topographic map of the painted area.
Note
If bad channels are not excluded they are shown in red.
Evoked
The evoked data.
str
| list
| slice
| None
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 all channels. Note that channels in
info['bads']
will be included if their names or indices are
explicitly provided.
list
of str
| ‘bads’Channels names to exclude from being shown. If ‘bads’, the bad channels are excluded.
Scale plot with channel (SI) unit.
Show figure if True.
dict
| None
Y limits for plots (after scaling has been applied). e.g. ylim = dict(eeg=[-20, 20]) Valid keys are eeg, mag, grad, misc. If None, the ylim parameter for each channel equals the pyplot default.
tuple
| None
X limits for plots.
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.
list
of float
| None
The values at which to show an horizontal line.
dict
| None
The units of the channel types used for axes labels. If None,
defaults to dict(eeg='µV', grad='fT/cm', mag='fT')
.
dict
| None
The scalings of the channel types to be applied for plotting. If None,
defaults to dict(eeg=1e6, grad=1e13, mag=1e15)
.
dict
| None
The titles associated with the channels. If None, defaults to
dict(eeg='EEG', grad='Gradiometers', mag='Magnetometers')
.
Axes
| list
| None
The axes to plot to. If list, the list must be a list of Axes of the same length as the number of channel types. If instance of Axes, there must be only one channel type plotted.
Plot the global field power (GFP) or the root mean square (RMS) of the data. For MEG data, this will plot the RMS. For EEG, it plots GFP, i.e. the standard deviation of the signal across channels. The GFP is equivalent to the RMS of an average-referenced signal.
True
Plot GFP or RMS (for EEG and MEG, respectively) and traces for all channels.
'only'
Plot GFP or RMS (for EEG and MEG, respectively), and omit the traces for individual channels.
The color of the GFP/RMS trace will be green if
spatial_colors=False
, and black otherwise.
Changed in version 0.23: Plot GFP for EEG instead of RMS. Label RMS traces correctly as such.
str
| None
The title to put at the top of the figure.
If True, the lines are color coded by mapping physical sensor coordinates into color values. Spatially similar channels will have similar colors. Bad channels will be dotted. If False, the good channels are plotted black and bad channels red. Defaults to False.
str
| callable()
Which channels to put in the front or back. Only matters if
spatial_colors
is used.
If str, must be std
or unsorted
(defaults to unsorted
). If
std
, data with the lowest standard deviation (weakest effects) will
be put in front so that they are not obscured by those with stronger
effects. If unsorted
, channels are z-sorted as in the evoked
instance.
If callable, must take one argument: a numpy array of the same
dimensionality as the evoked raw data; and return a list of
unique integers corresponding to the number of channels.
New in version 0.13.0.
Whether to use interactive features. If True (default), it is possible
to paint an area to draw topomaps. When False, the interactive features
are disabled. Disabling interactive features reduces memory consumption
and is useful when using axes
parameter to draw multiaxes figures.
New in version 0.13.0.
Covariance
| str
| None
Noise covariance used to whiten the data while plotting.
Whitened data channel names are shown in italic.
Can be a string to load a covariance from disk.
See also mne.Evoked.plot_white()
for additional inspection
of noise covariance properties when whitening evoked data.
For data processed with SSS, the effective dependence between
magnetometers and gradiometers may introduce differences in scaling,
consider using mne.Evoked.plot_white()
.
New in version 0.16.0.
str
The units for the time axis, can be “s” (default) or “ms”.
New in version 0.16.
float
| 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.
float
, shape(2,) | array-like of float
, shape (n, 2) | None
Segments of the data to highlight by means of a light-yellow
background color. Can be used to put visual emphasis on certain
time periods. The time periods must be specified as array-like
objects in the form of (t_start, t_end)
in the unit given by the
time_unit
parameter.
Multiple time periods can be specified by passing an array-like
object of individual time periods (e.g., for 3 time periods, the shape
of the passed object would be (3, 2)
. If None
, no highlighting
is applied.
New in version 1.1.
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.
matplotlib.figure.Figure
Figure containing the butterfly plots.
See also