Container for Time-Frequency data.
Can for example store induced power at sensor level or inter-trial coherence.
mne.Info
The mne.Info
object with information about the sensors and methods of measurement.
ndarray
, shape (n_channels, n_freqs, n_times)The data.
ndarray
, shape (n_times,)The time values in seconds.
ndarray
, shape (n_freqs,)The frequencies in Hz.
int
The number of averaged TFRs.
str
| None
, default None
Comment on the data, e.g., the experimental condition.
str
| None
, default None
Comment on the method used to compute the data, e.g., morlet wavelet.
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.
mne.Info
The mne.Info
object with information about the sensors and methods of measurement.
ch_names
list
Channel names.
int
Number of averaged epochs.
ndarray
, shape (n_channels, n_freqs, n_times)The data array.
times
ndarray
, shape (n_times,)Time vector in seconds.
ndarray
, shape (n_freqs,)The frequencies in Hz.
str
Comment on dataset. Can be the condition.
str
| None
, default None
Comment on the method used to compute the data, e.g., morlet wavelet.
Methods
|
Add instances. |
|
Check channel type membership. |
|
Multiply source instances. |
|
Subtract instances. |
|
Append new channels to the instance. |
|
Add reference channels to data that consists of all zeros. |
|
Baseline correct the data. |
|
Return a copy of the instance. |
|
Crop data to a given time interval in place. |
|
Decimate the time-series data. |
|
Drop channel(s). |
|
Get a list of channel type for each channel. |
|
Pick a subset of channels. |
|
Pick some channels. |
|
Pick some channels by type and names. |
|
Plot TFRs as a two-dimensional image(s). |
|
Plot TFRs as a two-dimensional image with topomaps. |
|
Plot TFRs in a topography with images. |
|
Plot topographic maps of time-frequency intervals of TFR data. |
|
Reorder channels. |
|
Save TFR object to hdf5 file. |
|
Shift time scale in epoched or evoked data. |
|
Convert time to indices. |
|
Export data in tabular structure as a pandas DataFrame. |
Check channel type membership.
str
Channel type to check for. Can be e.g. ‘meg’, ‘eeg’, ‘stim’, etc.
Whether or not the instance contains the given channel type.
Examples
Channel type membership can be tested as:
>>> 'meg' in inst
True
>>> 'seeg' in inst
False
Append new channels to the instance.
list
A list of objects to append to self. Must contain all the same type as the current object.
If True, force the info for objects to be appended to match the
values in self
. This should generally only be used when adding
stim channels for which important metadata won’t be overwritten.
New in version 0.12.
See also
Notes
If self
is a Raw instance that has been preloaded into a
numpy.memmap
instance, the memmap will be resized.
Add reference channels to data that consists of all zeros.
Adds reference channels to data that were not included during recording. This is useful when you need to re-reference your data to different channels. These added channels will consist of all zeros.
Baseline correct the data.
The time interval to apply rescaling / baseline correction. If None do not apply it. If baseline is (a, b) the interval is between “a (s)” and “b (s)”. If a is None the beginning of the data is used and if b is None then b is set to the end of the interval. If baseline is equal to (None, None) all the time interval is used.
Perform baseline correction by
subtracting the mean of baseline values (‘mean’)
dividing by the mean of baseline values (‘ratio’)
dividing by the mean of baseline values and taking the log (‘logratio’)
subtracting the mean of baseline values followed by dividing by the mean of baseline values (‘percent’)
subtracting the mean of baseline values and dividing by the standard deviation of baseline values (‘zscore’)
dividing by the mean of baseline values, taking the log, and dividing by the standard deviation of log baseline values (‘zlogratio’)
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.
AverageTFR
The modified instance.
Channel names.
The current gradient compensation grade.
Return a copy of the instance.
EpochsTFR
| instance of AverageTFR
A copy of the instance.
Crop data to a given time interval in place.
float
| None
Start time of selection in seconds.
float
| None
End time of selection in seconds.
float
| None
Lowest frequency of selection in Hz.
New in version 0.18.0.
float
| None
Highest frequency of selection in Hz.
New in version 0.18.0.
If True (default), include tmax. If False, exclude tmax (similar to how Python indexing typically works).
New in version 0.19.
AverageTFR
The modified instance.
Decimate the time-series data.
int
Factor by which to subsample the data.
Warning
Low-pass filtering is not performed, this simply selects
every Nth sample (where N is the value passed to
decim
), i.e., it compresses the signal (see Notes).
If the data are not properly filtered, aliasing artifacts
may occur.
int
Apply an offset to where the decimation starts relative to the sample corresponding to t=0. The offset is in samples at the current sampling rate.
New in version 0.12.
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.
The decimated object.
See also
Notes
For historical reasons, decim
/ “decimation” refers to simply subselecting
samples from a given signal. This contrasts with the broader signal processing
literature, where decimation is defined as (quoting
[1], p. 172; which cites
[2]):
“… a general system for downsampling by a factor of M is the one shown in Figure 4.23. Such a system is called a decimator, and downsampling by lowpass filtering followed by compression [i.e, subselecting samples] has been termed decimation (Crochiere and Rabiner, 1983).”
Hence “decimation” in MNE is what is considered “compression” in the signal processing community.
Decimation can be done multiple times. For example,
inst.decimate(2).decimate(2)
will be the same as
inst.decimate(4)
.
If decim
is 1, this method does not copy the underlying data.
New in version 0.10.0.
References
Drop channel(s).
See also
Notes
New in version 0.9.0.
Get a list of channel type for each channel.
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.
Whether to return only unique channel types. Default is False
.
Whether to ignore non-data channels. Default is False
.
list
The channel types.
Pick a subset of channels.
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
| str
Set of channels to exclude, only used when picking based on types (e.g., exclude=”bads” when picks=”meg”).
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.
New in version 0.24.0.
Pick some channels.
list
The list of channels to select.
If True (default False), ensure that the order of the channels in
the modified instance matches the order of ch_names
.
New in version 0.20.0.
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.
New in version 1.1.
See also
Notes
The channel names given are assumed to be a set, i.e. the order
does not matter. The original order of the channels is preserved.
You can use reorder_channels
to set channel order if necessary.
New in version 0.9.0.
Pick some channels by type and names.
str
If True include MEG channels. If string it can be ‘mag’, ‘grad’, ‘planar1’ or ‘planar2’ to select only magnetometers, all gradiometers, or a specific type of gradiometer.
If True include EEG channels.
If True include stimulus channels.
If True include EOG channels.
If True include ECG channels.
If True include EMG channels.
str
If True include CTF / 4D reference channels. If ‘auto’, reference
channels are included if compensations are present and meg
is
not False. Can also be the string options for the meg
parameter.
If True include miscellaneous analog channels.
If True
include respiratory channels.
If True include continuous HPI coil channels.
Flux excitation channel used to be a stimulus channel.
Internal Active Shielding data (maybe on Triux only).
System status channel information (on Triux systems only).
Stereotactic EEG channels.
Dipole time course channels.
Dipole goodness of fit channels.
Bio channels.
Electrocorticography channels.
str
Functional near-infrared spectroscopy channels. If True include all fNIRS channels. If False (default) include none. If string it can be ‘hbo’ (to include channels measuring oxyhemoglobin) or ‘hbr’ (to include channels measuring deoxyhemoglobin).
EEG-CSD channels.
Deep brain stimulation channels.
list
of str
List of additional channels to include. If empty do not include any.
list
of str
| str
List of channels to exclude. If ‘bads’ (default), exclude channels
in info['bads']
.
list
of str
Restrict sensor channels (MEG, EEG) to this list of channel names.
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.
See also
Notes
New in version 0.9.0.
Plot TFRs as a two-dimensional image(s).
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 good data channels. Note that channels
in info['bads']
will be included if their names or indices are
explicitly provided.
None
(default) or tuple
, shape (2,)The time interval to apply baseline correction. If None do not apply it. If baseline is (a, b) the interval is between “a (s)” and “b (s)”. If a is None the beginning of the data is used and if b is None then b is set to the end of the interval. If baseline is equal to (None, None) all the time interval is used.
Perform baseline correction by
subtracting the mean of baseline values (‘mean’) (default)
dividing by the mean of baseline values (‘ratio’)
dividing by the mean of baseline values and taking the log (‘logratio’)
subtracting the mean of baseline values followed by dividing by the mean of baseline values (‘percent’)
subtracting the mean of baseline values and dividing by the standard deviation of baseline values (‘zscore’)
dividing by the mean of baseline values, taking the log, and dividing by the standard deviation of log baseline values (‘zlogratio’)
None
| float
The first time instant to display. If None the first time point available is used. Defaults to None.
None
| float
The last time instant to display. If None the last time point available is used. Defaults to None.
None
| float
The first frequency to display. If None the first frequency available is used. Defaults to None.
None
| float
The last frequency to display. If None the last frequency available is used. Defaults to None.
float
| None
The minimum value an the color scale. If vmin is None, the data minimum value is used. Defaults to None.
float
| None
The maximum value an the color scale. If vmax is None, the data maximum value is used. Defaults to None.
The 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 ‘interactive’, translates to (‘RdBu_r’, True). Defaults to ‘RdBu_r’.
Warning
Interactive mode works smoothly only for a small amount of images.
If True, 10*log10 is applied to the data to get dB. Defaults to False.
If true, colorbar will be added to the plot. Defaults to True.
Call pyplot.show() at the end. Defaults to True.
str
| ‘auto’ | None
String for title
. Defaults to None (blank/no title). If
‘auto’, and combine
is None, the title for each figure
will be the channel name. If ‘auto’ and combine
is not None,
title
states how many channels were combined into that figure
and the method that was used for combine
. If str, that String
will be the title for each figure.
Axes
| list
| None
The axes to plot to. If list, the list must be a list of Axes of
the same length as picks
. If instance of Axes, there must be
only one channel plotted. If combine
is not None, axes
must either be an instance of Axes, or a list of length 1.
Layout
| None
Layout instance specifying sensor positions. Used for interactive plotting of topographies on rectangle selection. If possible, the correct layout is inferred from the data.
The scale of y (frequency) axis. ‘linear’ gives linear y axis, ‘log’ leads to log-spaced y axis and ‘auto’ detects if frequencies are log-spaced and only then sets the y axis to ‘log’.
New in version 0.14.0.
ndarray
| None
An array of booleans of the same shape as the data. Entries of the data that correspond to False in the mask are plotted transparently. Useful for, e.g., masking for statistical significance.
New in version 0.16.0.
None
| ‘both’ | ‘contour’ | ‘mask’If mask
is not None: if 'contour'
, a contour line is drawn
around the masked areas (True
in mask
). If 'mask'
,
entries not True
in mask
are shown transparently. If
'both'
, both a contour and transparency are used.
If None
, defaults to 'both'
if mask
is not None, and is
ignored otherwise.
New in version 0.17.
The colormap chosen for masked parts of the image (see below), if
mask
is not None
. If None, cmap
is reused. Defaults to
'Greys'
. Not interactive. Otherwise, as cmap
.
New in version 0.17.
float
A float between 0 and 1. If mask
is not None, this sets the
alpha level (degree of transparency) for the masked-out segments.
I.e., if 0, masked-out segments are not visible at all.
Defaults to 0.1.
New in version 0.16.0.
None
Type of aggregation to perform across selected channels. If None, plot one figure per selected channel.
list
of str
| ‘bads’Channels names to exclude from being shown. If ‘bads’, the bad channels are excluded. Defaults to an empty list.
matplotlib.colors.Normalize
| None
Colormap normalization, default None means linear normalization. If not
None, vmin
and vmax
arguments are ignored. See Notes for more
details.
New in version 0.24.
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.
list
of instances of matplotlib.figure.Figure
A list of figures containing the time-frequency power.
Examples using plot
:
Overview of MEG/EEG analysis with MNE-Python
Frequency and time-frequency sensor analysis
Time-frequency on simulated data (Multitaper vs. Morlet vs. Stockwell)
Decoding in time-frequency space using Common Spatial Patterns (CSP)
Plot TFRs as a two-dimensional image with topomaps.
None
| list
of tuple
| dict
of tuple
The time-frequency point(s) for which topomaps will be plotted. See Notes.
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 good data channels. Note that channels
in info['bads']
will be included if their names or indices are
explicitly provided.
None
(default) or tuple
of length 2The time interval to apply baseline correction. If None do not apply it. If baseline is (a, b) the interval is between “a (s)” and “b (s)”. If a is None, the beginning of the data is used. If b is None, then b is set to the end of the interval. If baseline is equal to (None, None), the entire time interval is used.
None
| str
If str, must be one of ‘ratio’, ‘zscore’, ‘mean’, ‘percent’, ‘logratio’ and ‘zlogratio’. Do baseline correction with ratio (power is divided by mean power during baseline) or zscore (power is divided by standard deviation of power during baseline after subtracting the mean, power = [power - mean(power_baseline)] / std(power_baseline)), mean simply subtracts the mean power, percent is the same as applying ratio then mean, logratio is the same as mean but then rendered in log-scale, zlogratio is the same as zscore but data is rendered in log-scale first. If None no baseline correction is applied.
None
| float
The first time instant to display. If None the first time point available is used.
None
| float
The last time instant to display. If None the last time point available is used.
None
| float
The first frequency to display. If None the first frequency available is used.
None
| float
The last frequency to display. If None the last frequency available is used.
float
| None
The minimum value of the color scale for the image (for
topomaps, see topomap_args
). If vmin is None, the data
absolute minimum value is used.
float
| None
The maximum value of the color scale for the image (for
topomaps, see topomap_args
). If vmax is None, the data
absolute maximum value is used.
The colormap to use.
If True, 10*log10 is applied to the data to get dB.
If true, colorbar will be added to the plot (relating to the topomaps). For user defined axes, the colorbar cannot be drawn. Defaults to True.
Call pyplot.show() at the end.
str
| None
String for title. Defaults to None (blank/no title).
The scale of y (frequency) axis. ‘linear’ gives linear y axis, ‘log’ leads to log-spaced y axis and ‘auto’ detects if frequencies are log-spaced and only then sets the y axis to ‘log’.
Type of aggregation to perform across selected channels.
list
of str
| ‘bads’Channels names to exclude from being shown. If ‘bads’, the
bad channels are excluded. Defaults to an empty list, i.e., []
.
None
| dict
A dict of kwargs
that are forwarded to
mne.viz.plot_topomap()
to style the topomaps. axes
and
show
are ignored. If times
is not in this dict, automatic
peak detection is used. Beyond that, if None
, no customizable
arguments will be passed.
Defaults to None
.
None
| dict
A dict of kwargs
that are forwarded to AverageTFR.plot()
to style the image. axes
and show
are ignored. Beyond that,
if None
, no customizable arguments will be passed.
Defaults to None
.
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
The figure containing the topography.
Notes
timefreqs
has three different modes: tuples, dicts, and auto.
For (list of) tuple(s) mode, each tuple defines a pair
(time, frequency) in s and Hz on the TFR plot. For example, to
look at 10 Hz activity 1 second into the epoch and 3 Hz activity
300 msec into the epoch,
timefreqs=((1, 10), (.3, 3))
If provided as a dictionary, (time, frequency) tuples are keys and (time_window, frequency_window) tuples are the values - indicating the width of the windows (centered on the time and frequency indicated by the key) to be averaged over. For example,
timefreqs={(1, 10): (0.1, 2)}
would translate into a window that spans 0.95 to 1.05 seconds, as well as 9 to 11 Hz. If None, a single topomap will be plotted at the absolute peak across the time-frequency representation.
New in version 0.16.0.
Examples using plot_joint
:
Frequency and time-frequency sensor analysis
Plot TFRs in a topography with images.
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 good data channels. Note that channels
in info['bads']
will be included if their names or indices are
explicitly provided.
None
(default) or tuple
of length 2The time interval to apply baseline correction. If None do not apply it. If baseline is (a, b) the interval is between “a (s)” and “b (s)”. If a is None the beginning of the data is used and if b is None then b is set to the end of the interval. If baseline is equal to (None, None) all the time interval is used.
Perform baseline correction by
subtracting the mean of baseline values (‘mean’)
dividing by the mean of baseline values (‘ratio’)
dividing by the mean of baseline values and taking the log (‘logratio’)
subtracting the mean of baseline values followed by dividing by the mean of baseline values (‘percent’)
subtracting the mean of baseline values and dividing by the standard deviation of baseline values (‘zscore’)
dividing by the mean of baseline values, taking the log, and dividing by the standard deviation of log baseline values (‘zlogratio’)
None
| float
The first time instant to display. If None the first time point available is used.
None
| float
The last time instant to display. If None the last time point available is used.
None
| float
The first frequency to display. If None the first frequency available is used.
None
| float
The last frequency to display. If None the last frequency available is used.
float
| None
The minimum value of the color scale. If vmin is None, the data minimum value is used.
float
| None
The maximum value of the color scale. If vmax is None, the data maximum value is used.
Layout
| None
Layout instance specifying sensor positions. If possible, the correct layout is inferred from the data.
str
The colormap to use. Defaults to ‘RdBu_r’.
str
Title of the figure.
If True, 10*log10 is applied to the data to get dB.
If true, colorbar will be added to the plot.
float
Scaling factor for adjusting the relative size of the layout on the canvas.
Call pyplot.show() at the end.
str
Matplotlib borders style to be used for each sensor plot.
The figure face color. Defaults to black.
None
| array
A background image for the figure. This must be a valid input to
matplotlib.pyplot.imshow
. Defaults to None.
The color of tick labels in the colorbar. Defaults to white.
The scale of y (frequency) axis. ‘linear’ gives linear y axis, ‘log’ leads to log-spaced y axis and ‘auto’ detects if frequencies are log-spaced and only then sets the y axis to ‘log’.
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
The figure containing the topography.
Examples using plot_topo
:
Frequency and time-frequency sensor analysis
Plot topographic maps of time-frequency intervals of TFR data.
None
| float
The first time instant to display. If None the first time point available is used.
None
| float
The last time instant to display. If None the last time point available is used.
None
| float
The first frequency to display. If None the first frequency available is used.
None
| float
The last frequency to display. If None the last frequency available is used.
None
The channel type to plot. For ‘grad’, the gradiometers are collected in pairs and the RMS for each pair is plotted. If None, then first available channel type from order given above is used. Defaults to None.
tuple
or list
of length 2The time interval to apply rescaling / baseline correction. If None do not apply it. If baseline is (a, b) the interval is between “a (s)” and “b (s)”. If a is None the beginning of the data is used and if b is None then b is set to the end of the interval. If baseline is equal to (None, None) all the time interval is used.
Perform baseline correction by
subtracting the mean of baseline values (‘mean’)
dividing by the mean of baseline values (‘ratio’)
dividing by the mean of baseline values and taking the log (‘logratio’)
subtracting the mean of baseline values followed by dividing by the mean of baseline values (‘percent’)
subtracting the mean of baseline values and dividing by the standard deviation of baseline values (‘zscore’)
dividing by the mean of baseline values, taking the log, and dividing by the standard deviation of log baseline values (‘zlogratio’)
float
| callable()
| None
The value specifying the lower bound of the color range. If None, and vmax is None, -vmax is used. Else np.min(data) or in case data contains only positive values 0. If callable, the output equals vmin(data). Defaults to None.
float
| callable()
| None
The value specifying the upper bound of the color range. If None, the maximum value is used. If callable, the output equals vmax(data). Defaults to None.
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 (default), ‘Reds’ is used for all positive data, otherwise defaults to ‘RdBu_r’. If ‘interactive’, translates to (None, True).
str
Add markers for sensor locations to the plot. Accepts matplotlib plot format string (e.g., ‘r+’ for red plusses). If True, a circle will be used (via .add_artist). Defaults to True.
Plot a colorbar.
dict
| str
| None
The unit of the channel type used for colorbar label. If scale is None the unit is automatically determined.
int
The resolution of the topomap image (n pixels along each side).
float
Side length per topomap in inches.
str
String format for colorbar values.
callable()
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 mask
is not None,
only significant sensors will be shown.
str
| None
Title. If None (default), no title is displayed.
Axes
| None
The axes to plot to. If None the axes is defined automatically.
Call pyplot.show() at the end.
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’.
int
| array
of float
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. If colorbar=True, the ticks in colorbar correspond to the contour levels. Defaults to 6.
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.
matplotlib.figure.Figure
The figure containing the topography.
Examples using plot_topomap
:
Frequency and time-frequency sensor analysis
Reorder channels.
list
The desired channel order.
See also
Notes
Channel names must be unique. Channels that are not in ch_names
are dropped.
New in version 0.16.0.
Save TFR object to hdf5 file.
str
The file name, which should end with -tfr.h5
.
If True (default False), overwrite the destination file if it exists.
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.
See also
Shift time scale in epoched or evoked data.
float
The (absolute or relative) time shift in seconds. If relative
is True, positive tshift increases the time value associated with
each sample, while negative tshift decreases it.
If True, increase or decrease time values by tshift
seconds.
Otherwise, shift the time values such that the time of the first
sample equals tshift
.
The modified instance.
Notes
This method allows you to shift the time values associated with each data sample by an arbitrary amount. It does not resample the signal or change the data values in any way.
Time vector in seconds.
Last time point.
First time point.
Export data in tabular structure as a pandas DataFrame.
Channels are converted to columns in the DataFrame. By default,
additional columns 'time'
, 'freq'
, 'epoch'
, and
'condition'
(epoch event description) are added, unless index
is not None
(in which case the columns specified in index
will
be used to form the DataFrame’s index instead). 'epoch'
, and
'condition'
are not supported for AverageTFR
.
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.
str
| list
of str
| None
Kind of index to use for the DataFrame. If None
, a sequential
integer index (pandas.RangeIndex
) will be used. If 'time'
, a
pandas.Float64Index
, pandas.Int64Index
, or
pandas.TimedeltaIndex
will be used
(depending on the value of time_format
). If a list of two or more string values, a pandas.MultiIndex
will be created.
Valid string values are 'time'
, 'freq'
, 'epoch'
, and
'condition'
for EpochsTFR
and 'time'
and 'freq'
for AverageTFR
.
Defaults to None
.
If True, the DataFrame is returned in long format where each row is one
observation of the signal at a unique combination of time point, channel, epoch number, and condition.
For convenience, a ch_type
column is added to facilitate subsetting the resulting DataFrame. Defaults to False
.
str
| None
Desired time format. If None
, no conversion is applied, and time values
remain as float values in seconds. If 'ms'
, time values will be rounded
to the nearest millisecond and converted to integers. If 'timedelta'
,
time values will be converted to pandas.Timedelta
values.
Default is None
.
New in version 0.23.
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.
pandas.DataFrame
A dataframe suitable for usage with other statistical/plotting/analysis packages.
mne.time_frequency.AverageTFR
#Overview of MEG/EEG analysis with MNE-Python
Frequency and time-frequency sensor analysis
Time-frequency on simulated data (Multitaper vs. Morlet vs. Stockwell)
Decoding in time-frequency space using Common Spatial Patterns (CSP)