很多时候画小图却没有大标题,这个mtext()命令可以补上。注意par()命令中的oma参数非常重要。
par(mfrow = c(2, 2), oma = c(0, 0, 3, 0))
plot(qnorm, main = expression(Phi^{-1}))
plot(qlogis, main = "The Inverse Logit : qlogis()")
abline(h = 0, v = 0:2/2, lty = 3, col = "gray")
curve(sin, -2*pi, 2*pi, xname = "t", main = "curve(sin)")
curve(tan, xname = "t", add = NA, main = "curve(tan)")
mtext("Plots of Different Functions", side = 3, line = 0, outer = T)
具体效果如下