ggml_ot.pl.plot_gmm_panel

Contents

ggml_ot.pl.plot_gmm_panel#

ggml_ot.pl.plot_gmm_panel(X, *, means=None, covs=None, projection=None, components=(0, 1), color_by=None, palette=None, ell_labels=None, mode_labels=None, n_signal=0, ax=None, figsize=(6, 5.5), point_alpha=0.12, title=None, xlabel=None, ylabel=None, show=None, save=None)[source]#

2-D scatter with optional GMM ellipse overlay.

Combines scatter_subspace(), _project_gmm(), and ellipse_overlay() into a single call.

Parameters:
X ndarray

(N, D) point array.

means Optional[ndarray] (default: None)

(K, D) GMM component means in the same space as X. When None only the scatter is drawn.

covs Optional[ndarray] (default: None)

(K, D, D) GMM component covariances.

projection Optional[ndarray] (default: None)

Optional linear projection applied to both X and means / covs. Uses the same (D, K_out) / (K_out, D) auto-transpose logic as scatter_subspace(). When None, components select columns of X / means / covs directly (assumes they are already 2-D or the first two dimensions carry the signal).

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

Pair of column indices to plot after projection.

color_by Optional[ndarray] (default: None)

Length-N array for hue.

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

Colour mapping for points and (when ell_labels is given) ellipses.

ell_labels Optional[ndarray] (default: None)

(K,) class labels for ellipse colouring.

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

Annotation strings for the leading n_signal components.

n_signal int (default: 0)

Number of leading components treated as signal (drawn more prominently by ellipse_overlay()).

ax Optional[Axes] (default: None)

Existing axes; creates a new figure when None.

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

Figure size when ax is None.

point_alpha float (default: 0.12)

Point opacity.

title Optional[str] (default: None)

Axis decoration.

xlabel Optional[str] (default: None)

Axis decoration.

ylabel Optional[str] (default: None)

Axis decoration.

show Optional[bool] (default: None)

Passed to savefig_or_show().

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

Passed to savefig_or_show().

Return type:

Axes

Returns:

matplotlib.axes.Axes