enigmatoolbox.plotting.surface_plotting.build_plotter(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), **kwargs)[source]

Build plotter arranged according to the layout (author: @OualidBenkarim)

  • 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).

  • kwargs (keyword-valued args) – Additional arguments passed to the renderers, actors, mapper, color_bar or plotter.


plotter – An instance of Plotter.

Return type



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.