mne.viz.plot_source_estimates¶

mne.viz.plot_source_estimates(stc, subject=None, surface='inflated', hemi='lh', colormap='auto', time_label='auto', smoothing_steps=10, transparent=True, alpha=1.0, time_viewer=False, subjects_dir=None, figure=None, views='lat', colorbar=True, clim='auto', cortex='classic', size=800, background='black', foreground='white', initial_time=None, time_unit='s', backend='auto', spacing='oct6', title=None, verbose=None)[source]

Plot SourceEstimate with PySurfer.

By default this function uses mayavi.mlab to plot the source estimates. If Mayavi is not installed, the plotting is done with matplotlib.pyplot (much slower, decimated source space by default).

Parameters
stcSourceEstimate

The source estimates to plot.

subject

The subject name corresponding to FreeSurfer environment variable SUBJECT. If None stc.subject will be used. If that is None, the environment will be used.

surfacestr

The type of surface (inflated, white etc.).

hemistr, ‘lh’ | ‘rh’ | ‘split’ | ‘both’

The hemisphere to display.

colormapstr | np.ndarray of float, shape(n_colors, 3 | 4)

Name of colormap to use or a custom look up table. If array, must be (n x 3) or (n x 4) array for with RGB or RGBA values between 0 and 255. The default (‘auto’) uses ‘hot’ for one-sided data and ‘mne’ for two-sided data.

time_label

Format of the time label (a format string, a function that maps floating point time values to strings, or None for no label). The default is time=%0.2f ms.

smoothing_stepsint

The amount of smoothing

transparent

If True, use a linear transparency between fmin and fmid. None will choose automatically based on colormap type.

alphafloat

Alpha value to apply globally to the overlay. Has no effect with mpl backend.

time_viewerbool

Display time viewer GUI.

subjects_dirstr

The path to the freesurfer subjects reconstructions. It corresponds to Freesurfer environment variable SUBJECTS_DIR.

figureinstance of mayavi.core.api.Scene | instance of matplotlib.figure.Figure | list | int | None

If None, a new figure will be created. If multiple views or a split view is requested, this must be a list of the appropriate length. If int is provided it will be used to identify the Mayavi figure by it’s id or create a new figure with the given id. If an instance of matplotlib figure, mpl backend is used for plotting.

views

View to use. See surfer.Brain. Supported views: [‘lat’, ‘med’, ‘ros’, ‘cau’, ‘dor’ ‘ven’, ‘fro’, ‘par’]. Using multiple views is not supported for mpl backend.

colorbarbool

If True, display colorbar on scene.

clim

Colorbar properties specification. If ‘auto’, set clim automatically based on data percentiles. If dict, should contain:

kind‘value’ | ‘percent’

Flag to specify type of limits.

limslist | np.ndarray | tuple of float, 3 elements

Lower, middle, and upper bounds for colormap.

pos_limslist | np.ndarray | tuple of float, 3 elements

Lower, middle, and upper bound for colormap. Positive values will be mirrored directly across zero during colormap construction to obtain negative control points.

Note

Only one of lims or pos_lims should be provided. Only sequential colormaps should be used with lims, and only divergent colormaps should be used with pos_lims.

cortex

Specifies how binarized curvature values are rendered. Either the name of a preset PySurfer cortex colorscheme (one of ‘classic’, ‘bone’, ‘low_contrast’, or ‘high_contrast’), or the name of mayavi colormap, or a tuple with values (colormap, min, max, reverse) to fully specify the curvature colors. Has no effect with mpl backend.

size

The size of the window, in pixels. can be one number to specify a square window, or the (width, height) of a rectangular window. Has no effect with mpl backend.

backgroundmatplotlib color

Color of the background of the display window.

foregroundmatplotlib color

Color of the foreground of the display window. Has no effect with mpl backend.

initial_time

The time to display on the plot initially. None to display the first time sample (default).

time_unit‘s’ | ‘ms’

Whether time is represented in seconds (“s”, default) or milliseconds (“ms”).

backend‘auto’ | ‘mayavi’ | ‘matplotlib’

Which backend to use. If 'auto' (default), tries to plot with mayavi, but resorts to matplotlib if mayavi is not available.

New in version 0.15.0.

spacingstr

The spacing to use for the source space. Can be 'ico#' for a recursively subdivided icosahedron, 'oct#' for a recursively subdivided octahedron, or 'all' for all points. In general, you can speed up the plotting by selecting a sparser source space. Has no effect with mayavi backend. Defaults to ‘oct6’.

New in version 0.15.0.

title

Title for the figure. If None, the subject name will be used.

New in version 0.17.0.

verbose

If not None, override default verbose level (see mne.verbose() and Logging documentation for more).

Returns
figure

An instance of surfer.Brain from PySurfer or matplotlib figure.