Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在两行中绘制了 5 个箱线图(箱线图)par(mfrow = c(2,5), oma = c(0,0,2,2))。
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放在第二行箱线图上方?
您可以使用mtext在任何您想要的地方绘制标题。
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)