[R] Overall Title in par(mfrow)

John Fox jfox at mcmaster.ca
Mon Sep 23 13:28:31 CEST 2002


Dear Kevin,

At 03:57 PM 9/23/2002 +1200, Ko-Kang Kevin Wang wrote:
>Hi,
>
>Say I did something like:
>   par(mfrow = c(1, 2))
>   plot(1:10)
>   plot(1:10)
>
>and I'd like to have an overall title, i.e. a title that would appear,
>centered, on the top of both plots, rather than the top of the last plot.
>
>I tried:
>   title("FOO", outer = T)
>but it doesn't appear right.  Half of the FOO is outside the figure region
>and can't be seen...
>
>Is there another way to achieve this?

Here's one solution:

     par(mfrow = c(1, 2))
     plot(1:10)
     plot(1:10)
     text(locator(1), "FOO", cex=1.5, xpd=NA)

Click the mouse where you want the centre of the title.

I hope that this helps,
  John
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list