plot_dendrogram: Plot dendrogram

View source: R/graphics_plot_dendrogram.R

plot_dendrogramR Documentation

Plot dendrogram

Description

Dendrogram plot for an hclust or dendrogram object using ggplot2.

Usage

plot_dendrogram(hc, labels = TRUE, label_size = 3, title = NULL)

Arguments

hc

an object of class hclust or dendrogram

labels

logical; whether to draw leaf labels

label_size

label text size

title

optional plot title

Details

Converts a dendrogram into line segments and renders it with ggplot2.

Value

returns a ggplot2::ggplot graphic

Examples

data(iris)
hc <- hclust(dist(scale(iris[,1:4])), method = "ward.D2")
grf <- plot_dendrogram(hc)
plot(grf)

daltoolbox documentation built on Feb. 10, 2026, 9:06 a.m.