eelbrain.plot.GlassBrain.butterfly
- classmethod GlassBrain.butterfly(y, cmap=None, vmin=None, vmax=None, dest='mri', mri_resolution=False, mni305=None, black_bg=False, display_mode=None, threshold=None, colorbar=False, alpha=0.7, plot_abs=False, draw_arrows=True, symmetric_cbar='auto', interpolation='nearest', w=5, h=2.5, xlim=None, name=None, **kwargs)[source]
Shortcut for a butterfly-plot with a time-linked glassbrain plot
- Parameters:
y (NDVar) – Data to plot, should have shape
([case,] time, source[, space]); ifndvarhas a case dimension, the mean is plotted.cmap (Any) – Colormap (name of a matplotlib colormap).
vmin (float) – Plot data range minimum.
vmax (float) – Plot data range maximum.
dest (Literal['mri', 'surf']) – If ‘mri’ the volume is defined in the coordinate system of the original T1 image. If ‘surf’ the coordinate system of the FreeSurfer surface is used (Surface RAS).
mri_resolution (bool) – If True the image will be created in MRI resolution. WARNING: it can result in significantly high memory usage.
mni305 (bool) – Project data from MNI-305 space to MNI-152 space (by default this is enabled iff the source space subject is
fsaverage).black_bg (bool) – If True, the background of the image is set to be black.
display_mode (str) –
Direction of the cuts:
'x': sagittal'y': coronal'z': axial'l': sagittal, left hemisphere only'r': sagittal, right hemisphere only'ortho': three cuts in orthogonal directions, equivalent to'yxz'
Possible values are: ‘ortho’, ‘x’, ‘y’, ‘z’, ‘xz’, ‘yx’, ‘yz’, ‘l’, ‘r’, ‘lr’, ‘lzr’, ‘lyr’, ‘lzry’, ‘lyrz’. Default depends on hemispheres in data.
threshold (float | Literal['auto']) – If a number is given, values below the threshold (in absolute value) are plotted as transparent. If
'auto'is given, the threshold is determined magically by analysis of the image.colorbar (bool) – If True, display a colorbar on the right of the plots.
alpha (float) – Alpha transparency for the brain schematics
plot_abs (bool) – Plot the maximum intensity projection of the absolute value (rendering positive and negative values in the same manner). By default, (
False), the sign of the maximum intensity will be represented with different colors. See examples. Only affects GlassBrain plot.draw_arrows (bool) – Draw arrows in the direction of activation over the glassbrain plots. Naturally, for this to work
ndvarneeds to contain space dimension (i.e 3D vectors). By default it is set toTrue.symmetric_cbar (bool | Literal['auto']) – Specifies whether the colorbar should range from -vmax to vmax or from vmin to vmax. Setting to ‘auto’ will select the latter if the range of the whole image is either positive or negative. Note: The colormap will always be set to range from -vmax to vmax.
interpolation (str) – Interpolation to use when resampling the image to the destination space. Can be “continuous” (default) to use 3rd-order spline interpolation, or “nearest” to use nearest-neighbor mapping. “nearest” is faster but can be noisier in some cases.
w (float) – Butterfly plot width (inches).
h (float) – Plot height (inches; applies to butterfly and brain plot).
xlim (float | tuple[float, float]) – Initial x-axis view limits as
(left, right)tuple or aslengthscalar (default is the full x-axis in the data).name (str) – The window title (default is ndvar.name).
- Returns:
butterfly_plot (plot.Butterfly) – Butterfly plot.
glassbrain (GlassBrain) – GlassBrain plot.
- Return type: