# mne.viz.plot_vector_source_estimates¶

mne.viz.plot_vector_source_estimates(stc, subject=None, hemi='lh', colormap='hot', time_label='auto', smoothing_steps=10, transparent=None, brain_alpha=0.4, overlay_alpha=None, vector_alpha=1.0, scale_factor=None, time_viewer='auto', 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', show_traces='auto', verbose=None)[source]

Plot VectorSourceEstimate with PySurfer.

A “glass brain” is drawn and all dipoles defined in the source estimate are shown using arrows, depicting the direction and magnitude of the current moment at the dipole. Additionally, an overlay is plotted on top of the cortex with the magnitude of the current.

Parameters
stcVectorSourceEstimate

The vector source estimate 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.

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. This should be a sequential colormap.

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 'auto', which will use time=%%0.2f ms if there is more than one time point.

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.

brain_alphafloat

Alpha value to apply globally to the surface meshes. Defaults to 0.4.

overlay_alphafloat

Alpha value to apply globally to the overlay. Defaults to brain_alpha.

vector_alphafloat

Alpha value to apply globally to the vector glyphs. Defaults to 1.

scale_factor

Scaling factor for the vector glyphs. By default, an attempt is made to automatically determine a sane value.

time_viewer

Display time viewer GUI. Can be “auto”, which is True for the PyVista backend and False otherwise.

Changed in version 0.20: Added “auto” option and default.

subjects_dirstr

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

figure

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.

views

View to use. See surfer.Brain.

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 bound for colormap.

Unlike stc.plot, it cannot use pos_lims, as the surface plot must show the magnitude.

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.

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.

backgroundmatplotlib color

Color of the background of the display window.

foregroundmatplotlib color

Color of the foreground of the display window.

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”).

show_traces

If True, enable interactive picking of a point on the surface of the brain and plot it’s time course using the bottom 1/3 of the figure. This feature is only available with the PyVista 3d backend when time_viewer=True. Defaults to ‘auto’, which will use True if and only if time_viewer=True, the backend is PyVista, and there is more than one time point.

New in version 0.20.0.

verbose

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

Returns
brainsurfer.Brain

A instance of surfer.Brain from PySurfer.

Notes

New in version 0.15.

If the current magnitude overlay is not desired, set overlay_alpha=0 and smoothing_steps=1.