MText:较小的标签描述使用布局时
-
21-12-2019 - |
题
使用MText for Label描述与使用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)
.
解决方案
当使用布局时,世代odicetagcode中的世代odicetagcode的含义不同,但由于其活动在各个绘图区域之外,我不会预期延伸到MText。您可以通过反转预期系数为2/3:
,反转“生效”-cex=1
内的“有效”-plot
内的默认减少
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 _not_ smaller",
ylab="this is _not_ smaller, either",
main="This is my title",
cex.lab=3/2)
par(op)
.
进一步阅读:
?par # scroll down to mfcol, mfrow
. 不隶属于 StackOverflow