我很困惑。在绘图的标题、标签和其他位置增加文本字体大小的正确方法是什么?
例如
x <- rnorm(100)
hist(x, xlim=range(x), xlab= "Variable Label",
ylab="density", main="Title of plot", prob=TRUE, ps=30)
ps
参数不会更改字体大小(但它在?par
的R帮助中显示为“文本的磅大小(但不是符号)”)。
还可以将更改字体大小与绘图功能(如hist
)分开
发布于 2010-11-22 10:41:49
您需要类似于cex=1.5
参数的内容来将字体缩放150 %。但要看到help(par)
,因为还有cex.lab
,cex.axis
,...
发布于 2012-06-06 10:28:32
因此,为了总结现有的讨论,添加了
cex.lab=1.5, cex.axis=1.5, cex.main=1.5, cex.sub=1.5
对于您的绘图,1.5可以是2、3等,默认值为1会增加字体大小。
x <- rnorm(100)
cex不会改变事情
hist(x, xlim=range(x),
xlab= "Variable Lable", ylab="density", main="Title of plot", prob=TRUE)
hist(x, xlim=range(x),
xlab= "Variable Lable", ylab="density", main="Title of plot", prob=TRUE,
cex=1.5)
添加cex.lab=1.5、cex.axis=1.5、cex.main=1.5、cex.sub=1.5
hist(x, xlim=range(x),
xlab= "Variable Lable", ylab="density", main="Title of plot", prob=TRUE,
cex.lab=1.5, cex.axis=1.5, cex.main=1.5, cex.sub=1.5)
发布于 2017-10-17 23:40:44
当我想使轴标签更小,但保持其他所有标签的大小不变时,我遇到了这个问题。对我有效的命令是:
par(cex.axis=0.5)
在plot命令之前。只需记住放入:
par(cex.axis=1.0)
打印后,确保字体恢复为默认大小。
https://stackoverflow.com/questions/4241798
复制相似问题