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?
Cheers,
Kevin
------------------------------------------------------------------------------
Ko-Kang Kevin Wang
Postgraduate PGDipSci Student
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
The outer margins are all 0's by default. You need to increase it for at least side 3 (e.g., par(oma=c(0,0,2,0))). Andy> -----Original Message----- > From: Ko-Kang Kevin Wang [mailto:kwan022 at stat.auckland.ac.nz] > Sent: Sunday, September 22, 2002 11:58 PM > To: R Help > Subject: [R] Overall Title in par(mfrow) > > > 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? > > Cheers, > > Kevin > > -------------------------------------------------------------- > ---------------- > Ko-Kang Kevin Wang > Postgraduate PGDipSci Student > Department of Statistics > University of Auckland > New Zealand > Homepage: http://www.stat.auckland.ac.nz/~kwan022 > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. > -.-.-.-.-.-.-.-.- > r-help mailing list -- Readhttp://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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._ ------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it. ============================================================================= -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
One quick solution is to set par(mfrow=c(1,1)) before title("TITLE")
(without the outer option).
A probably better one is to set the 'oma' option in par() right before
title() (and after doing the plot), which sets the outer margins. Ex:
par(mfrow = c(1, 2))
plot(1:10)
plot(1:10)
par(oma=c(0,0,2,0))
title("TITLE" , outer=TRUE)
Daniel
At 03:57 PM 23/9/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?
>
>Cheers,
>
>Kevin
>
>------------------------------------------------------------------------------
>Ko-Kang Kevin Wang
>Postgraduate PGDipSci Student
>Department of Statistics
>University of Auckland
>New Zealand
>Homepage: http://www.stat.auckland.ac.nz/~kwan022
>
>
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>.-.-
>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
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>._._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
par(mfrow=c(2,2),oma=0.1+c(0,0,4,0))
...
...
...
mtext(MainLabel,line=2,outer=TRUE)
-----Original Message-----
From: Ko-Kang Kevin Wang [mailto:kwan022 at stat.auckland.ac.nz]
Sent: Montag, 23. September 2002 05:58
To: R Help
Subject: [R] Overall Title in par(mfrow)
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?
Cheers,
Kevin
------------------------------------------------------------------------
------
Ko-Kang Kevin Wang
Postgraduate PGDipSci Student
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._._._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._