plot_habitat_clustering_pca_3d
Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.
- plot_habitat_clustering_pca_3d(features: ndarray, labels: ndarray, *, centers: ndarray | None = None, title: str | None = None, n_clusters: int | None = None, palette: Sequence[str] | None = None, alpha: float = 0.35, marker_size: int = 20, center_marker: str = 'X', center_size: int = 50, center_color: str = '#000000', max_legend_items: int = 10)[source]
Three-dimensional PCA scatter of habitat clustering units.
Mirrors the v0.1 static 3D branch of
plot_cluster_resultswith English-only labels and no filesystem side effects.- Parameters:
features – Feature matrix, shape
(n_samples, n_features).labels – Habitat assignment per row, shape
(n_samples,).centers – Optional centroid matrix, shape
(n_habitats, n_features).title – Figure title; defaults to a population-level English caption.
n_clusters – Selected cluster count for the default title.
palette – Optional colour cycle.
alpha – Scatter-point transparency in
[0, 1].marker_size – Scatter marker area in points squared.
center_marker – Marker style for centroids.
center_size – Centroid marker area in points squared.
center_color – Centroid colour.
max_legend_items – Hide the legend when the habitat count exceeds this.
- Returns:
A matplotlib
Figurewith a 3D axes.