ggml_ot.pl.scatter_subspace#
- ggml_ot.pl.scatter_subspace(X, *, color_by=None, style_by=None, projection=None, components=(0, 1), palette=None, ax=None, s=15, alpha=0.3, xlabel=None, ylabel=None, title=None, legend=True, show=None, save=None)[source]#
2-D scatter plot of points in a subspace.
Works with any point cloud: raw observations, AnnData-backed data, or projected samples.
- Parameters:
- X
ndarray (N, D)point array.- color_by
Optional[ndarray] (default:None) Length-N array for hue (class label, mode name, …).
- style_by
Optional[ndarray] (default:None) Length-N array for marker style (patient id, …).
- projection
Optional[ndarray] (default:None) Optional
(D, K)or(K, D)linear-projection matrix. WhenNone,componentsselect columns from X directly.- components
tuple[int,int] (default:(0, 1)) Pair of component indices to plot (default
(0, 1)).- palette
UnionType[dict,str,None] (default:None) Colour palette —
dict, colormap name, orNone.- ax
Optional[Axes] (default:None) Existing axes; a new figure is created when
None.- s
float(default:15) Marker size.
- alpha
float(default:0.3) Point opacity.
- xlabel
Optional[str] (default:None) Axis labels.
- ylabel
Optional[str] (default:None) Axis labels.
- title
Optional[str] (default:None) Plot title.
- legend
bool(default:True) Whether to show a legend.
- show
Optional[bool] (default:None) Passed to
ggml_ot.plot._utils.savefig_or_show().- save
UnionType[str,bool,None] (default:None) Passed to
ggml_ot.plot._utils.savefig_or_show().
- X
- Return type:
Axes- Returns:
matplotlib.axes.Axes