enigmatoolbox.plotting.surface_plotting.plot_surf

enigmatoolbox.plotting.surface_plotting.plot_surf(surfs, layout, array_name=None, view=None, color_bar=None, color_range=None, share=False, label_text=None, cmap='viridis', nan_color=(0, 0, 0, 1), zoom=1, background=(1, 1, 1), size=(400, 400), embed_nb=False, interactive=True, scale=(1, 1), transparent_bg=True, screenshot=False, filename=None, return_plotter=False, **kwargs)[source]

Plot surfaces arranged according to the layout (author: @OualidBenkarim)

Parameters:
  • surfs (dict[str, BSPolyData]) – Dictionary of surfaces.
  • layout (array-like, shape = (n_rows, n_cols)) – Array of surface keys in surfs. Specifies how window is arranged.
  • array_name (array-like, optional) – Names of point data array to plot for each layout entry. Use a tuple with multiple array names to plot multiple arrays (overlays) per layout entry. Default is None.
  • view (array-like, optional) – View for each each layout entry. Possible views are {‘lateral’, ‘medial’, ‘ventral’, ‘dorsal’}. If None, use default view. Default is None.
  • color_bar ({'left', 'right', 'top', 'bottom'} or None, optional) – Location where color bars are rendered. If None, color bars are not included. Default is None.
  • 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.
  • share ({'row', 'col', 'both'} or bool, optional) – If share == 'row', point data for surfaces in the same row share same data range. If share == 'col', the same but for columns. If share == 'both', all data shares same range. If True, similar to share == 'both'. Default is False.
  • 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.
  • cmap (str or sequence of str, optional) – Color map name (from matplotlib) for each array name. Default is ‘viridis’.
  • 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).
  • size (tuple, optional) – Window size. Default is (400, 400).
  • 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 renderers, actors, mapper or plotter.
Returns:

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

Return type:

Ipython Image or panel or None

Notes

If sequences, shapes of array_name, view and zoom must be equal or broadcastable to the shape of layout. Renderer keywords must also be broadcastable to the shape of layout.

If sequences, shapes of cmap and cbar_range must be equal or broadcastable to the shape of array_name, including the number of array names per entry. Actor and mapper keywords must also be broadcastable to the shape of array_name.