fuzzyclust.plotting#

Matplotlib helpers for inspecting clustering results.

All functions accept an optional ax and return the Axes they drew on; they never call plt.show(). Colors follow a fixed, color-blind-safe categorical order (Okabe–Ito palette); cluster \(i\) always gets color PALETTE[i % len(PALETTE)].

Scatter, contour, ellipse and validity plots shared by the examples.

Functions#

plot_clusters(X[, labels, centers, ax, ...])

Scatter plot of 2-D data colored by (hard) cluster label with prototypes.

plot_membership_contours(estimator, X[, ax, ...])

Contour map of the maximal membership \(\max_i \mu_i(\mathbf{x})\) over the plane.

plot_covariance_ellipses(centers, covariances)

Draw the \(n_\text{std}\)-sigma ellipses of (fuzzy) covariance matrices.

plot_validity_scan(table[, ax, normalize])

Plot validity indices versus the number of clusters.

plot_objective(estimators[, labels, ax])

Objective \(J\) versus iteration for one or several fitted estimators.

plot_membership_profiles(U[, ax, x, stacked])

Membership degrees \(\mu_{ik}\) of every cluster along the sample index.

Constants#

PALETTE

Okabe–Ito color-blind-safe palette, fixed assignment order.