Note

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.

8.10.19. nilearn.plotting.plot_surf_contours

nilearn.plotting.plot_surf_contours(surf_mesh, roi_map, axes=None, figure=None, levels=None, labels=None, colors=None, legend=False, cmap='tab20', title=None, output_file=None, **kwargs)

Plotting contours of ROIs on a surface, optionally over a statistical map.

Parameters:

surf_mesh: str or list of two numpy.ndarray

Surface mesh geometry, can be a file (valid formats are .gii or Freesurfer specific files such as .orig, .pial, .sphere, .white, .inflated) or a list of two Numpy arrays, the first containing the x-y-z coordinates of the mesh vertices, the second containing the indices (into coords) of the mesh faces.

roi_map: str or numpy.ndarray or list of numpy.ndarray

ROI map to be displayed on the surface mesh, can be a file (valid formats are .gii, .mgz, .nii, .nii.gz, or Freesurfer specific files such as .annot or .label), or a Numpy array with a value for each vertex of the surf_mesh. The value at each vertex one inside the ROI and zero inside ROI, or an integer giving the label number for atlases.

axes: instance of matplotlib axes, None, optional

The axes instance to plot to. The projection must be ‘3d’ (e.g., figure, axes = plt.subplots(subplot_kw={‘projection’: ‘3d’}), where axes should be passed.). If None, uses axes from figure if available, else creates new axes.

figure: instance of matplotlib figure, None, optional

The figure instance to plot to. If None, uses figure of axes if available, else creates a new figure.

levels: list of integers, or None, optional

A list of indices of the regions that are to be outlined. Every index needs to correspond to one index in roi_map. If None, all regions in roi_map are used.

labels: list of strings or None, or None, optional

A list of labels for the individual regions of interest. Provide None as list entry to skip showing the label of that region. If None no labels are used.

colors: list of matplotlib color names or RGBA values, or None.

legend: boolean, optional

Whether to plot a legend of region’s labels.

cmap: matplotlib colormap, str or colormap object, default is None

To use for plotting of the contours. Either a string which is a name of a matplotlib colormap, or a matplotlib colormap object.

title : str, optional

Figure title.

output_file: str, or None, optional

The name of an image file to export 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.

See also

nilearn.datasets.fetch_surf_fsaverage
For surface data object to be used as background map for this plotting function.
nilearn.plotting.plot_surf_stat_map
for plotting statistical maps on brain surfaces.

8.10.19.1. Examples using nilearn.plotting.plot_surf_contours