mechanochat.plotting.plot_grid_signal_tensor#

mechanochat.plotting.plot_grid_signal_tensor(Xgrid, Vegrid, scale=150, pivot='tail', headwidth=3, headlength=3.5, headaxislength=3, width=0.004, color='k', linestyle='-', scale_units='width', th: float = 0., ax=None)[source]#

Draw the grid-level signal orientation tensors from tl.signal_tensor.

Each grid cell gets four arrows, the two eigenvectors in both directions, so the glyph is a cross whose arms are as long as the corresponding eigenvalue: an elongated cross means the communication of that grid cell is aligned along one axis, a symmetric one means it is isotropic.

Parameters:
  • Xgrid (ndarray) – (n_grid, 2) grid positions

  • Vegrid (ndarray) – (n_grid, 2, 2) eigenvectors scaled by their eigenvalues, from tl.signal_tensor

  • scale (float, default 150) – Quiver scale; larger values give shorter arms

  • pivot (str, default 'tail') – Quiver pivot

  • headwidth (float) – Arrow head geometry

  • headlength (float) – Arrow head geometry

  • headaxislength (float) – Arrow head geometry

  • width (float, default 0.004) – Arrow shaft width

  • color (color, default 'k') – Arrow color

  • linestyle (str, default '-') – Arrow line style

  • scale_units (str, default 'width') – Quiver scale units

  • th (float, default 0.) – Grid cells whose tensor norm is below this threshold are skipped

  • ax (Axes, optional) – Target matplotlib axes object. Creates new figure if None

Returns:

ax (Axes)