ggml_ot.pl.panel_subspaces

ggml_ot.pl.panel_subspaces#

ggml_ot.pl.panel_subspaces(data=None, *, adata=None, projection=None, components=(0, 1), palette=None, color_key='labels', mode_labels=None, figsize=(18, 5.5), point_alpha_3d=0.4, point_alpha_2d=0.15, elev=25, azim=130, show=None, save=None)[source]#

Three-panel figure: mixed 3-D | rotated 2-D | clean 2-D (or learned).

Accepts either the raw data dict from synth_gmm() or an AnnData produced by synth_gmm_anndata(). When projection is supplied, the third panel shows the learned subspace instead of the ground-truth clean space.

Parameters:
data Optional[dict] (default: None)

Dict returned by ggml_ot.data.synth_gmm().

adata default: None

AnnData from ggml_ot.data.synth_gmm_anndata() (alternative to data).

projection Optional[ndarray] (default: None)

Learned (D, K) projection matrix. When given, the third panel shows data projected through it.

components tuple[int, int] (default: (0, 1))

Component indices for 2-D panels (default (0, 1)).

palette UnionType[dict, str, None] (default: None)

Colour mapping for class labels.

color_key str (default: 'labels')

Which metadata to colour by ("labels", "mode_names", "signal_noise", "patient_ids").

mode_labels Optional[Sequence[str]] (default: None)

Math-mode labels for signal components (default auto).

figsize tuple[float, float] (default: (18, 5.5))

Figure size.

point_alpha_3d float (default: 0.4)

Point opacities.

point_alpha_2d float (default: 0.15)

Point opacities.

elev float (default: 25)

Camera angles for the 3-D panel.

azim float (default: 130)

Camera angles for the 3-D panel.

show Optional[bool] (default: None)

Passed to savefig_or_show.

save UnionType[str, bool, None] (default: None)

Passed to savefig_or_show.

Return type:

Figure

Returns:

matplotlib.figure.Figure