【发布时间】:2014-09-22 09:27:42
【问题描述】:
使用 mtext 作为标签描述与使用 xlab 有不同的作用。如何使 mtext 标签的大小始终与使用 xlab 时的大小相同(而不总是定义 cex 参数)。在下面的最小示例中 cex=cex.lab=1 两个数字。但是大小不同。
layout(matrix(c(1,1,2,2), ncol=1))
op<-par(mar=c(4,4,2,1))
plot(1:10, xlab="", ylab="", main="This is my title")
mtext("this is the x-axis", side=1, line=2.75, cex=1)
mtext("this is the y-axis", side=2, line=2.5, cex=1)
plot(1:10, xlab="this is smaller", ylab="this is smaller", main="This is my title", cex.lab=1)
par(op)
【问题讨论】:
-
为什么不对两个图都使用
xlab或mtext? -
或者使用
title(xlab="this is the x-axis", ylab="this is the y-axis")而不是mtext。
标签: r plot labels axis-labels par