stack_cross()
tanglegram
This example demonstrates how to create a tanglegram—a paired visualization of two dendrogram-aligned with cross-links between related elements.
stack_crossh(mat1) +
align_dendro(aes(color = branch), k = 3L) +
scale_x_reverse() +
cross_link(link_line(), data = mat2) +
align_dendro(aes(color = branch), k = 2L) -
no_expansion("x") -
scale_color_brewer(palette = "Dark2") -
theme(plot.margin = margin())