【问题标题】:Adding y label to dendextend dendrogram添加y标签到dendextend树状图
【发布时间】:2018-11-06 23:14:57
【问题描述】:

如何向dendextend 生成的树状图添加 y 标签?例如,这可用于标记“成对距离”。

水平 (ggplot(horiz = T)) 树状图呢?

【问题讨论】:

    标签: r ggplot2 dendrogram dendextend


    【解决方案1】:

    axis.title.y 必须在主题中指定才能显示文本。例如:

    dend %>% 
      ggplot() + 
      labs(y = "Pairwise Euclidean Distance") + 
      theme(axis.title.y = element_text(angle = 90))
    

    对于水平树状图,y 指定为labs(),但现在我们需要在theme() 中使用axis.title.x。我只能通过指定color = "black" 来显示文本。不知道为什么。

    dend %>% 
      ggplot() + 
      labs(y = "Pairwise Euclidean Distance") + 
      theme(axis.title.x = element_text(color = "black"))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-30
      • 2017-10-29
      • 2017-12-26
      • 2016-08-13
      • 2014-02-24
      • 2021-08-11
      • 2019-07-15
      相关资源
      最近更新 更多