在 R 3.01 中更改簇树状图的标签大小 [英] Change label size of Cluster Dendrogram in R 3.01

查看:31
本文介绍了在 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.

推荐答案

您可以在调用 之前使用 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆