qis.plot_dendrogram

qis.plot_dendrogram(linkage, labels, cutoff=None, ax=None, orientation='right', title=None, fontsize=10, show_distance=True, **kwargs)[source]

Plot an existing full linkage with optional cluster-cutoff annotation.

Parameters:
  • linkage (ndarray) – SciPy linkage array, with N-1 rows and four columns.

  • labels (Sequence[str]) – N display labels in the original observation order.

  • cutoff (float | None) – Nonnegative merge distance for branch colouring and a black cut line.

  • ax (Axes | None) – Destination axis; create a figure when omitted.

  • orientation (str) – SciPy orientation: right, left, top or bottom.

  • title (str | None) – Optional axis heading.

  • fontsize (float) – Leaf-label font size.

  • show_distance (bool) – Show merge-distance tick labels.

  • **kwargs – Additional SciPy dendrogram styling options. Tree truncation and label replacement are excluded to preserve the full supplied leaf identity.

Returns:

The axis containing the dendrogram.

Raises:

ValueError – If the tree, cutoff, orientation or identity-changing options are invalid.

Return type:

Axes