我用hcluster生成了一个集群。original dendogram。
出于格式化目的,我使用了as.dendogram。当我这样做的时候,我的标签被剪掉了。vertical dendogram
更多的是通过水平方向。这就是我需要的。horizontal dendogram
这个问题看起来不像是在边距上,因为(对于水平的)我使用了没有标签效果的par(oma = c(0, 0, 0, 8)。这只会减少我的边际空间,但不会给标签名称留出更多空间。如何确保绘图显示整个型号名称?
发布于 2018-07-20 20:57:54
您可能应该在par()中更改mar而不是oma
mm <- matrix(rnorm(20), ncol = 4)
colnames(mm) <- c("leaf1", "leaf2", "leaf3", "very_long_leaf_realy")
# compare:
plot(as.dendrogram(hclust(dist(t(mm)))), horiz = TRUE)
# with:
oldpar <- par(mar = c(5, 4 ,4 , 8))
plot(as.dendrogram(hclust(dist(t(mm)))), horiz = TRUE)
par(oldpar) # restoring ploting parametershttps://stackoverflow.com/questions/51442380
复制相似问题