Note
Go to the end to download the full example code.
Showing only some clustersΒΆ
The subtrees parameter can be specified as only a subset of clusters, i.e., their union does not necessarily cover all data points.
import plotly.graph_objects as go
import plotly.io as pio
import scipy
from pdendro import attach_dendrogram
X = [[0.0], [1.0], [3.0], [6.0]]
Z = scipy.cluster.hierarchy.linkage(X)
fig = go.Figure()
attach_dendrogram(fig, Z, subtrees={4})
pio.show(fig)