brainspace.plotting.surface_plotting.plot_hemispheres

brainspace.plotting.surface_plotting.plot_hemispheres(surf_lh, surf_rh, array_name=None, color_bar=False, color_range=None, label_text=None, layout_style='row', cmap='viridis', nan_color=(0, 0, 0, 1), zoom=1, background=(1, 1, 1), size=(400, 400), interactive=True, embed_nb=False, screenshot=False, filename=None, scale=(1, 1), transparent_bg=True, **kwargs)[source]

Plot left and right hemispheres in lateral and medial views.

Parameters:
  • surf_lh (vtkPolyData or BSPolyData) – Left hemisphere.
  • surf_rh (vtkPolyData or BSPolyData) – Right hemisphere.
  • array_name (str, list of str, ndarray or list of ndarray, optional) – Name of point data array to plot. If ndarray, the array is split for the left and right hemispheres. If list, plot one row per array. Default is None.
  • color_bar (bool, optional) – Plot color bar for each array (row). Default is False.
  • color_range ({'sym'}, tuple or sequence.) – Range for each array name. If ‘sym’, uses a symmetric range. Only used if array has positive and negative values. Default is None.
  • label_text (dict[str, array-like], optional) – Label text for column/row. Possible keys are {‘left’, ‘right’, ‘top’, ‘bottom’}, which indicate the location. Default is None.
  • layout_style (str) – Layout style for hemispheres. If ‘row’, layout is a single row alternating lateral and medial views, from left to right. If ‘grid’, layout is a 2x2 grid, with lateral views in the top row, medial views in the bottom row, and left and right columns. Default is ‘row’.
  • nan_color (tuple) – Color for nan values. Default is (0, 0, 0, 1).
  • zoom (float or sequence of float, optional) – Zoom applied to the surfaces in each layout entry.
  • background (tuple) – Background color. Default is (1, 1, 1).
  • cmap (str, optional) – Color map name (from matplotlib). Default is ‘viridis’.
  • size (tuple, optional) – Window size. Default is (800, 200).
  • interactive (bool, optional) – Whether to enable interaction. Default is True.
  • embed_nb (bool, optional) – Whether to embed figure in notebook. Only used if running in a notebook. Default is False.
  • screenshot (bool, optional) – Take a screenshot instead of rendering. Default is False.
  • filename (str, optional) – Filename to save the screenshot. Default is None.
  • transparent_bg (bool, optional) – Whether to us a transparent background. Only used if screenshot==True. Default is False.
  • scale (tuple, optional) – Scale (magnification). Only used if screenshot==True. Default is None.
  • kwargs (keyword-valued args) – Additional arguments passed to the plotter.
Returns:

figure (Ipython Image or None) – Figure to plot. None if using vtk for rendering (i.e., embed_nb == False).