ggml_ot.pl.ellipse_overlay

ggml_ot.pl.ellipse_overlay#

ggml_ot.pl.ellipse_overlay(means, covs, ax, *, labels=None, palette=None, color_mode='signal', mode_labels=None, n_signal=0, diagonal_approx=True, lw_signal=3.0, lw_noise=2.5, alpha_signal=1.0, alpha_noise=0.5, fill_alpha_signal=0.2, fill_alpha_noise=0.05, annotate=True, annotation_fontsize=16)[source]#

Draw GMM covariance ellipses onto an existing axes.

Parameters:
means ndarray

(K, 2) array of component means.

covs ndarray

(K, 2, 2) array of component covariances.

ax Axes

Matplotlib axes to draw on.

labels Optional[ndarray] (default: None)

Per-component labels used for colouring components.

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

Colour mapping — see _resolve_palette().

color_mode Literal['signal', 'all', 'none'] (default: 'signal')

"signal" colours only signal modes, "all" colours every component, and "none" keeps all ellipses grey.

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

Optional per-component text annotations (e.g. math names).

n_signal int (default: 0)

Number of leading components that are signal (the rest are noise).

diagonal_approx bool (default: True)

If True, overlay a dashed diagonal-approximation ellipse on signal modes.

lw_signal float (default: 3.0)

Line widths for signal / noise ellipses.

lw_noise float (default: 2.5)

Line widths for signal / noise ellipses.

alpha_signal float (default: 1.0)

Edge-colour alpha for signal / noise.

alpha_noise float (default: 0.5)

Edge-colour alpha for signal / noise.

fill_alpha_signal float (default: 0.2)

Face-colour alpha for signal / noise.

fill_alpha_noise float (default: 0.05)

Face-colour alpha for signal / noise.

annotate bool (default: True)

Whether to annotate signal modes with mode_labels.

annotation_fontsize float (default: 16)

Font size for mode labels.

Return type:

Axes

Returns:

matplotlib.axes.Axes