Equally spaced out lengths in dendrograms [closed]

女生的网名这么多〃 提交于 2019-12-12 03:07:00

问题


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:


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)

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).



来源:https://stackoverflow.com/questions/37563747/equally-spaced-out-lengths-in-dendrograms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!