【问题标题】:Equally spaced out lengths in dendrograms [closed]树状图中等距的长度[关闭]
【发布时间】:2016-06-01 08:48:10
【问题描述】:

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

我想让树状图易于阅读,因此边缘应该成比例地长。要使用的任何具体参数还是只是数据的问题?

【问题讨论】:

    标签: r dendrogram ggdendro


    【解决方案1】:

    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)
    

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

    【讨论】:

    • 完美!这行得通。
    猜你喜欢
    • 1970-01-01
    • 2020-04-30
    • 2016-07-31
    • 1970-01-01
    • 1970-01-01
    • 2017-05-15
    • 1970-01-01
    • 2020-04-25
    • 2017-08-16
    相关资源
    最近更新 更多