0

我在两行中绘制了 5 个箱线图(箱线图)par(mfrow = c(2,5), oma = c(0,0,2,2))

par(mfrow = c(2,5),oma = c(0, 2, 2, 0))
boxplot(x,...)
title (main = "title1", outer = T)
boxplot(y,...)
title (main = "title2", outer = T)#overwrites title 1

如何将title2放在第二行箱线图上方?

4

1 回答 1

1

您可以使用mtext在任何您想要的地方绘制标题。

data("mtcars")
par(mfrow = c(2,5),oma = c(0, 2, 2, 0))
replicate(10,boxplot( mpg~cyl,mtcars))
mtext("title1",line = 0,outer=T,font = 2)
mtext("title2",line = -24,outer=T,font = 2)

在此处输入图像描述

于 2016-02-15T14:52:40.790 回答