树形图中的间距相等

时间:2016-06-01 08:48:10

标签: r dendrogram ggdendro

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

我想使树形图易于阅读,因此边缘应按比例长。要使用的任何具体参数还是仅仅是数据的问题?

1 个答案:

答案 0 :(得分:0)

ape可以选择绘制没有边长的树(或树形图)。

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

这会调用plot.phylo函数,使您可以操纵树形图的外观。要提高标签的易读性,您可能需要在plot内修改影响字体大小(cex = 0.7)或标签偏移(label.offset = 0.5)的设置。

相关问题