用par(mfrow)编译的图形面板的常见主标题 [英] Common main title of a figure panel compiled with par(mfrow)
问题描述
我编制了4张与 par(mfrow = c(2,2))
一起绘制的图。我想为上述2个地块绘制一个共同标题,并在两个左右两个地块之间居中的下面两个图板共同标题。
这可能吗?
/ em>工作,但是你需要玩弄行
参数来使它恰到好处:
<$ ($ ir $ $ Petal.Width)
plot(iris $ Sepal.Length ,iris $ Petal.Width)
plot(iris $ Sepal.Width,iris $ Petal.Width)
plot(iris $ Sepal.Length,iris $ Petal.Width)
mtext(我的'标题'在一个陌生的地方,side = 3,line = -21,outer = TRUE)
mtext
代表margin text。 side = 3
表示将它放在顶部边距中。 line = -21
表示将位置偏移21行。 outer = TRUE
表示可以使用外部空白区域。
要添加另一个标题顶部,你可以添加它,例如, mtext(我的'标题'在一个陌生的地方,侧= 3,行= -2,外= TRUE)
I have a compilation of 4 plots drawn together with par(mfrow=c(2,2))
. I would like to draw a common title for the 2 above plots and a common title for the 2 below panels that are centered between the 2 left and right plots.
Is this possible?
This should work, but you'll need to play around with the line
argument to get it just right:
par(mfrow = c(2, 2))
plot(iris$Petal.Length, iris$Petal.Width)
plot(iris$Sepal.Length, iris$Petal.Width)
plot(iris$Sepal.Width, iris$Petal.Width)
plot(iris$Sepal.Length, iris$Petal.Width)
mtext("My 'Title' in a strange place", side = 3, line = -21, outer = TRUE)
mtext
stands for "margin text". side = 3
says to place it in the "top" margin. line = -21
says to offset the placement by 21 lines. outer = TRUE
says it's OK to use the outer-margin area.
To add another "title" at the top, you can add it using, say, mtext("My 'Title' in a strange place", side = 3, line = -2, outer = TRUE)
这篇关于用par(mfrow)编译的图形面板的常见主标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!