mechanochat.plotting.contact_plot#
- mechanochat.plotting.contact_plot(ctri: cell_tri_dev, vis_key: Literal['mechanical interaction', 'tension', 'tension1'], mean_edge_value: bool = True, line_width: float = 2, cid_list: ndarray[Any, dtype[int64]] | ndarray[Any, dtype[bool_]] | Sequence[int] | None = None, pair_list: ndarray[Any, dtype[int64]] | None = None, norm: Normalize | None = None, cmap_name: str = 'inferno', show_axis: bool = False, ax: Axes | None = None, rotation: Dict | None = None, return_norm: bool = False)[source]#
Plot cell-cell contact mechanical signals as colored line segments.
Requires
contact_analysisto be run beforehand on thectriobject.- Parameters:
ctri (
cell_triorcell_tri_dev) – Cell triangulation object containing contact geometry and force datavis_key (
{'mechanical interaction', 'tension', 'tension1'}) –Signal to visualize:
'mechanical interaction'— cell-cell mechanical interaction force (also renders junction segments separately)'tension'— contact edge tension'tension1'— mean tension per contact pair
mean_edge_value (
bool, defaultTrue) – If True, assign the mean signal value uniformly to all segments of each contact edge; if False, use per-segment valuesline_width (
float, default2) – Width of the contact line segmentscid_list (
array-like, optional) – Cell indices to include. Default: all cellspair_list (
ndarrayofshape (n,2), optional) – Restrict display to specific cell-pair indices. Default: all pairsnorm (
Normalize, optional) – Matplotlib normalization object for colormap mapping. Default: 5th–95th percentile of the signalcmap_name (
str, default'inferno') – Valid matplotlib colormap nameax (
Axes, optional) – Target matplotlib axes object. Creates new figure if None.rotation (
dict, optional) –Rotate coordinates before plotting. Expected keys:
'center'— rotation center, array of shape (2,)'theta'— rotation angle in radians
return_norm (
bool, defaultFalse) – If True, also return the normalization object and colormap
- Returns:
ax (
Axes) – Ifreturn_norm=False(ax, norm, cmap) (
tuple) – Ifreturn_norm=True