bfieldtools.viz.plot_data_on_vertices

bfieldtools.viz.plot_data_on_vertices(mesh, data, figure=None, figsize=(800, 800), colorbar=False, ncolors=256, interpolate=True, cull_front=False, cull_back=False, autoscale=False, vmin=None, vmax=None, **kwargs)

Plot scalar data defined on the vertices of a mesh.

Parameters
mesh: Trimesh mesh object
data: (N_verts, ) array

Scalar data to plot on mesh vertices

figure: existing mlab figure

Optional, if passed will plot to existing figure

figsize: (x, y) tuple

Optional, if plotting to new figure specifies the size (in pixels)

cmap: str

name of colormap to use for scalar data. If None (default), use viridis for all-positive/-negative data and RdBu otherwise

colorbar: Boolean

If True, plot colorbar for scalar data

ncolors: int

Number of colors to use

interpolate: Boolean

If True, interpolate scalar data for smoother look

opacity: float

Opacity of rendered mesh

Returns
fig: mlab figure