c2v.pl.group_scatter

Contents

c2v.pl.group_scatter#

c2v.pl.group_scatter(adata, groupby, groups=None, s=30, ncols=4, group_color='black', frameon=False, square=True, kwargs_background=None, kwargs_group=None, ax=None, title=None, return_fig=False, basis='X_umap', show=True, figsize=None)#

Plots the spatial distribution of a single clone on a 2D embedding.

First plots all cells as a background, then overlays the selected clone using a distinct color.

Parameters:
adata AnnData

AnnData object with cell metadata and embeddings.

groupby str

Column in adata.obs indicating clonal identity.

groups list[str] | str | None

Clones to be highlighted. If None, all groups are shown.

frameon list[bool] | bool, optional

Whether to show axes frame in the plot. Default is False.

square bool, optional

Whether to set the aspect ratio of the plot to be equal. Default is True.

s list[float] | float, optional

Dot size for the highlighted clone. Default is 30.

kwargs_background list[dict] | dict | None, optional

Additional plotting arguments for the background cells.

kwargs_group list[dict] | dict | None, optional

Additional plotting arguments for the highlighted clone.

group_color list[str] | str, optional

Color to use for the highlighted clone. Default is “black”.

ax matplotlib.axes.Axes | list[matplotlib.axes.Axes] | None, optional

Axes object to draw the plot on. If None, a new figure is created.

title list[str] | str, optional

Plot title. If None, uses the clone name.

return_fig bool, optional

If True, returns the Matplotlib Figure object. Default is False.

basis list[str] | str, optional

Embedding key in adata.obsm to use for coordinates. Default is “X_umap”.

show bool, optional

Whether to show the plot. Default is True.

figsize tuple[float, float], optional

Figure size. Default is None.

ncols int

Return type:

Figure | Axes | ndarray | list[Axes] | None

Returns:

None | matplotlib.figure.Figure | matplotlib.axes.Axes | np.ndarray | list[matplotlib.axes.Axes] Returns Figure if return_fig is True; otherwise returns None.