mtext:使用布局时较小的标签描述 [英] mtext: smaller labels description when layout is used
问题描述
使用mtext作为标签说明与使用xlab有所不同.我如何使多行文字标签的大小始终与使用xlab时的大小相同(而不必始终定义cex参数).在下面的最小示例中,两个图都为cex = cex.lab = 1.但是大小不同.
Using mtext for the label description does something different than using xlab. How can I make the mtext labels be always the same size as it would be when using xlab (without defining always the cex argument). In the minimal example below cex=cex.lab=1 for both figures. However the size is different.
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)
推荐答案
使用布局时,plot
中的cex=1
的含义不同,但是由于它的活动,我不希望这种差异扩展到mtext.在各个绘图区域之外.您可以通过反转2/3的预期因子来反转plot
内部有效"-cex
的默认减少量:
When layout is used, the meaning of cex=1
in plot
is different, but I would not have expected that difference to extend to mtext since its activities are outside the individual plotting regions. You can reverse the default reduction in "effective"-cex
inside plot
by inverting the expected factor of 2/3:
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
这篇关于mtext:使用布局时较小的标签描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!