mechanochat.plotting.highlight_cell#
- mechanochat.plotting.highlight_cell(sem: SEM2, cid_list, color: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float], ax: Axes | None = None, ns: int = 8, r: float = 10., ar: float | None = None, face_alpha: float = 0.1, edge_alpha: float = 0.9, lw: float = 1.5, zorder: int = 2, rotation: Dict | None = None, scaling: bool = True, show_axis: bool = True)[source]#
Highlight a group of cells with a unified color overlay using alpha shape.
- Parameters:
sem (
SEM) – Subcellular element method objectcid_list (
array-like) – Cell indices to highlight. Accepts int, bool array, or list of indices. If None, all cells are selected.color (
color) –Highlight color. Accepts:
Named color string, e.g.
'r','blue'Hex string, e.g.
'#FF5733'RGB array/list/tuple with values in [0, 1], e.g.
[0.2, 0.6, 0.8]
ax (
Axes, optional) – Target matplotlib axes object. Creates new figure if None.ns (
int, default8) – Number of elements per segment used byAlphaShaper (
float, default10.0) – Neighbor search radius forAlphaShapear (
float, optional) – Alpha radius controlling the concavity of the outline. Default: the largest alpha radius among the selected cells, which follows the cell shapes closelyface_alpha (
float, default0.1) – Face opacity of the highlighted region, 0 (fully transparent), 1 (fully opaque)edge_alpha (
float, default0.9) – Edge opacity of the highlighted region, 0 (fully transparent), 1 (fully opaque)lw (
float, default1.5) – Boundary line widthzorder (
int, default2) – Matplotlib draw order of the overlayrotation (
dict, optional) – Rotate the coordinates before plotting. Keys: ‘center’ (2,) and ‘theta’ (radians)scaling (
bool, defaultTrue) – If True, transform element coordinates from simulation space to spatial units
- Returns:
ax (
Axes)