【问题标题】:How to zoom a circular dendrogram in R?如何在R中缩放圆形树状图?
【发布时间】:2019-05-18 03:16:52
【问题描述】:

我在 R 中有这个圆形树状图,我想放大它。我该如何进行? 这里是:

使用了以下代码:

library(dendextend)
library(circlize)

load(file = "hc1.rda")
#out1 <- cutree(hc1, k = 50)
load(file = "out1.rda")

dend <- as.dendrogram(hc1)
dorder <- order.dendrogram(dend)

colrs = colorRampPalette(c("blue", "red"))(50)
#library(colorBrewer)
# modify the dendrogram to have some colors in the branches and labels
dend1 <- color_branches(dend, col=colrs , 
                        clusters=out1)
#plot(dend1)

# plot the radial plot
par(mar = rep(0,4))
   circlize_dendrogram(dend1, labels_track_height = NA, 
                    dend_track_height = .4, labels = FALSE) 

【问题讨论】:

  • “缩放”到底是什么意思?你想要的结果是什么?
  • 这意味着我希望我的图表看起来更大。
  • 嗯,你现在怎么看?使用 Rstudio 中的图像查看器?只是把窗口放大。
  • 是的,我这样做了,但我想使用代码获得更大的图像。我还注意到,当我放大它时,线条(分支)太细了。看起来不太好。
  • 不是您在此处编写的代码决定了大小。大小取决于您选择的输出设备。你想创建一个pdf()png() 还是什么?如果要控制大小,则需要写入文件。看起来像你cannot set the size of the image view in Rstudio programmatically。到底你到底想要什么还不清楚。

标签: r plot dendrogram dendextend circlize


【解决方案1】:

已经很晚了,但我尝试了另一种方法来解决这个问题。在导出图像/pdf 时,我更改了尺寸通常是 4 的倍数。我希望它会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多