eelbrain.plot.brain.p_map

eelbrain.plot.brain.p_map(p_map, param_map=None, p0=0.05, p1=0.01, p0alpha=0.5, *args, **kwargs)

Plot a map of p-values in source space.

Parameters:
p_map : NDVar | NDTest

Map of p values, or test result.

param_map : NDVar

Statistical parameter covering the same data points as p_map. Only the sign is used, for incorporating the directionality of the effect into the plot.

p0 : scalar

Highest p-value that is visible.

p1 : scalar

P-value where the colormap changes from ramping alpha to ramping color.

p0alpha : 1 >= float >= 0

Alpha at p0. Set to 0 for a smooth transition, or a larger value to clearly delineate significant regions (default 0.5).

surf : ‘inflated’ | ‘pial’ | ‘smoothwm’ | ‘sphere’ | ‘white’

Freesurfer surface to use as brain geometry.

views : str | iterator of str

View or views to show in the figure. Options are: ‘rostral’, ‘parietal’, ‘frontal’, ‘ventral’, ‘lateral’, ‘caudal’, ‘medial’, ‘dorsal’.

hemi : ‘lh’ | ‘rh’ | ‘both’ | ‘split’

Which hemispheres to plot (default based on data).

colorbar : bool

Add a colorbar to the figure (use .plot_colorbar() to plot a colorbar separately).

time_label : str

Label to show time point. Use 'ms' or 's' to display time in milliseconds or in seconds, or supply a custom format string to format time values (in seconds; default is 'ms').

w, h, axw, axh : scalar

Layout parameters (figure width/height, subplot width/height).

foreground : mayavi color

Figure foreground color (i.e., the text color).

background : mayavi color

Figure background color.

parallel : bool

Set views to parallel projection (default True).

cortex : str | tuple | dict

Mark gyri and sulci on the cortex. Presets: 'classic' (default), 'high_contrast', 'low_contrast', 'bone'. Can also be a single color (e.g. 'red', (0.1, 0.4, 1.)) or a tuple of two colors for gyri and sulci (e.g. ['red', 'blue'] or [(1, 0, 0), (0, 0, 1)]). For all options see the PySurfer documentation.

title : str

title for the window (default is the subject name).

smoothing_steps : None | int

Number of smoothing steps if data is spatially undersampled (pysurfer Brain.add_data() argument).

mask : bool | matplotlib color

Shade areas that are not in p_map. Can be matplotlib color, including alpha (e.g., (1, 1, 1, 0.5) for semi-transparent white).

subjects_dir : None | str

Override the subjects_dir associated with the source space dimension.

name : str

Equivalent to title, for consistency with other plotting functions.

Returns:
brain : surfer.Brain

PySurfer Brain instance containing the plot.

Notes

In order to make economical use of the color lookup table, p-values are remapped for display. P-values larger than p0 are mapped to 0, p-values for positive effects to [step, p0 + step] and p-values for negative effects to [-step, -(p0 + step)].

Due to this, in order to plot a colorbar only including positive differences yse:

>>> brain.plot_colorbar(clipmin=0)

and to include only negative effects:

>>> brain.plot_colorbar(clipmax=0)