在R 3.01中更改簇树状图的标签大小 [英] Change label size of Cluster Dendrogram in R 3.01
本文介绍了在R 3.01中更改簇树状图的标签大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人发现R 3中明显的错误的变通办法,该错误禁止更改簇树状图上的标签大小吗?
Has anybody found a workaround to the apparent bug in R 3 which prohibits changing the label size on a Cluster Dendrogram?
以下代码在将R更新到3.01之前可以正常工作(我认为以前的版本是2.15):
The following code used to work fine before updating R to 3.01 (prior version was 2.15 I think):
plot(hclust, labels = data[, 1], cex = 0.3)
现在,更改cex
参数时,标签大小没有变化.
Now there is no change to label size when altering the cex
argument.
推荐答案
在调用plot()
之前,可以使用par()
函数设置cex
参数.例如:
You could set the cex
parameter using the par()
function before the call to plot()
. For example:
# example from ?hclust
hc <- hclust(dist(USArrests), "ave")
# default label size
plot(hc, xlab="xlab", ylab="ylab", main="main", sub="")
# reduced label size
par(cex=0.3, mar=c(5, 8, 4, 1))
plot(hc, xlab="", ylab="", main="", sub="", axes=FALSE)
par(cex=1)
title(xlab="xlab", ylab="ylab", main="main")
axis(2)
这篇关于在R 3.01中更改簇树状图的标签大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文