Equally spaced out lengths in dendrograms [closed]

2019-09-13 01:47发布

In this diagram, the main information (most nodes) is on the extreme left side.

I want to make the dendrogram easy to read and thus the edges should be proportionally long. Any specific arguments to be used or is it just the data's problem?

1条回答
Evening l夕情丶
2楼-- · 2019-09-13 02:26

Package ape has an option for plotting a tree (or dendrogram) without edge lengths.

library(ape)

# calculate dendrogram from sample data
data(carnivora)

tr <- hclust(dist(carnivora[1:20,6:15]))

# convert dendrogram from class 'hclust' to 'phylo'
tr <- as.phylo(tr)

# plot, use par(mfrow=c(1,3)) to display side by side
plot(tr)
plot(tr, use.edge.length = FALSE)
plot(tr, use.edge.length = FALSE, node.depth = 2)

trees

This calls the plot.phylo function and enables you to manipulate how the dendrogram looks like. To improve legibility of labels, you might need to tinker settings within plot that influence font size (cex = 0.7) or offset of the label (label.offset = 0.5).

查看更多
登录 后发表回答