eigenstrapping.plotting.meshplot

eigenstrapping.plotting.meshplot(mesh, scalars=None, vrange=(-4, 4), cmap='viridis', colorbar=False, cam=[0, 0])[source]

Automated plotting of surface in mesh. mesh must be a *.vtk-like file or a list-like of arrays (vertices, faces). If given, scalars must be a 1D vector and have the same number of entries as the longest axis of vertices. If not given as default, function simply plots gray surface (cmap, vrange do nothing)

Parameters:
  • mesh (file or list-like) – Surface mesh to plot scalars on.

  • scalars (1D ndarray, optional) – 1D vector on mesh. Default None (not given)

  • vrange (float or tuple, optional) – Min and max range to visualize scalars. Anything higher or lower is truncated. If one number is given (positive or negative) then assumed to be maximum and sign of vrange is flipped to give minimum. Default is (-4, 4).

  • cmap (str, optional) – Colormap of scalars. Accepts recognized matplotlib.cm types. Default is ‘viridis’.

  • colorbar (bool, optional) – Add colorbar to plot. Default is False.

  • cam (list-like, optional) – Elevation and azimuthal angle for camera. Default [30, 60] i.e., elev=30, azim=60.

Returns:

  • fig (matplotlib.figure handle)

  • ax (matplotlib.ax handle)