[R] Title for graph with multiple plots

(Ted Harding) Ted.Harding at manchester.ac.uk
Sat Jul 19 19:29:04 CEST 2008


On 19-Jul-08 10:29:43, Tolga Uzuner wrote:
> Dear R Users,
> I am attempting to place a title to a graph with multiple plots that 
> should go across the top of all the graphs, and not just one of them. I
> am using mfrow in par to plot. Can anyone suggest if and how this could
> be done ?
> Thanks in advance,
> Tolga

The following post from Erin Hodgess gives an example of how to do it:

Date: Thu, 12 Jun 2008 11:17:28 -0500
Sender: r-help-bounces at r-project.org
From: Erin Hodgess <erinm.hodgess at gmail.com>
To: Trevor.A.Craney at shell.com
Subject: Re: [R] overall title
Cc: r-help at r-project.org

Please try this:

z1 <- rexp(100)
z2 <- rexp(100)
z3 <- rexp(100)
z4 <- rexp(100)
par(mfrow=c(2,2),oma = c(0, 0, 3, 0))
curve(dexp,from=0,to=5)
hist(z1,main="first")
hist(z2,main="second")
hist(z3,main="third")
mtext("Densities", outer = TRUE, cex = 1.5)

Hope this helps.

Sincerely,
Erin


On Thu, Jun 12, 2008 at 10:38 AM,  <Trevor.A.Craney at shell.com> wrote:
> I have a 2x2 plot set up using:  par(mfrow=c(2,2))
> I'd like to put an overall title on the page, but I cannot figure
> out how. Any ideas?

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 19-Jul-08                                       Time: 18:29:01
------------------------------ XFMail ------------------------------



More information about the R-help mailing list