omicverse.pl._plot_backend.plot_ConvexHull¶
- omicverse.pl._plot_backend.plot_ConvexHull(adata, basis, cluster_key, hull_cluster, ax, color=None, alpha=0.2)[source]¶
Add convex hull outline for a specific cluster in embedding plot.
- Parameters:
adata (AnnData object containing single-cell data.)
basis (Embedding basis name in adata.obsm (e.g., 'X_umap', 'X_tsne').)
cluster_key (Column name for cluster assignments in adata.obs.)
hull_cluster (Specific cluster identifier to outline.)
ax (Matplotlib axes object to draw on.)
color (Hull color. Default: None (automatic).)
alpha (Hull transparency level. Default: 0.2.)
- Returns:
ax: Modified matplotlib axes object with convex hull added.
Examples – >>> import omicverse as ov >>> import matplotlib.pyplot as plt >>> # Create embedding plot with convex hull >>> fig, ax = plt.subplots() >>> ov.pl.embedding(adata, basis=’X_umap’, color=’leiden’, ax=ax) >>> ov.utils.plot_ConvexHull(adata, basis=’X_umap’, cluster_key=’leiden’, … hull_cluster=’0’, ax=ax)