This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.


nilearn.plotting.plot_glass_brain(stat_map_img, output_file=None, display_mode='ortho', colorbar=False, figure=None, axes=None, title=None, threshold='auto', annotate=True, black_bg=False, cmap=None, alpha=0.7, vmin=None, vmax=None, plot_abs=True, symmetric_cbar='auto', **kwargs)

Plot 2d projections of an ROI/mask image (by default 3 projections: Frontal, Axial, and Lateral). The brain glass schematics are added on top of the image.


stat_map_img : Niimg-like object

See The statistical map image. It needs to be in MNI space in order to align with the brain schematics.

output_file : string, or None, optional

The name of an image file to export the plot to. Valid extensions are .png, .pdf, .svg. If output_file is not None, the plot is saved to a file, and the display is closed.

display_mode : {‘ortho’, ‘x’, ‘y’, ‘z’}

Choose the direction of the cuts: ‘x’ - saggital, ‘y’ - coronal, ‘z’ - axial, ‘ortho’ - three cuts are performed in orthogonal directions.

colorbar : boolean, optional

If True, display a colorbar on the right of the plots.

figure : integer or matplotlib figure, optional

Matplotlib figure used or its number. If None is given, a new figure is created.

axes : matplotlib axes or 4 tuple of float: (xmin, ymin, width, height), optional

The axes, or the coordinates, in matplotlib figure space, of the axes used to display the plot. If None, the complete figure is used.

title : string, optional

The title displayed on the figure.

threshold : a number, None, or ‘auto’

If None is given, the image is not thresholded. If a number is given, it is used to threshold the image: 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.

annotate: boolean, optional :

If annotate is True, positions and left/right annotation are added to the plot.

black_bg: boolean, optional :

If True, the background of the image is set to be black. If you wish to save figures with a black background, you will need to pass “facecolor=’k’, edgecolor=’k’” to matplotlib.pyplot.savefig.

cmap: matplotlib colormap, optional :

The colormap for specified image

alpha: float between 0 and 1 :

Alpha transparency for the brain schematics

vmax: float :

Upper bound for plotting, passed to matplotlib.pyplot.imshow

plot_abs: boolean, optional :

If set to True (default) maximum intensity projection of the absolute value will be used (rendering positive and negative values in the same manner). If set to false the sign of the maximum intensity will be represented with different colors. See for examples.

symmetric_cbar: boolean or ‘auto’, optional, default ‘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.


Arrays should be passed in numpy convention: (x, y, z) ordered.