Re: [R] Main Title for multiple charts

From: Sundar Dorai-Raj <sundar.dorai-raj_at_pdf.com>
Date: Fri 08 Jul 2005 - 06:40:05 EST

Laura Holt wrote:
> Hi R !
>
> I have the following set up:
>

>> par(mfrow=c(2,2))
>> curve(dexp,from=0,to=5)
>> hist(z1,main="Size 5")
>> hist(z2,main="Size 15")
>> hist(z3,main="Size 30")
>>

>
> I would like to put a title at the very top of the page that ties the
> theme of all the charts
> together. How would this be done, please?
>

How about this:

z1 <- rexp(100)
z2 <- rexp(100)
z3 <- rexp(100)

par(mfrow=c(2,2),oma = c(0, 0, 3, 0))
curve(dexp,from=0,to=5)
hist(z1,main="Size 5")
hist(z2,main="Size 15")
hist(z3,main="Size 30")

mtext("Densities", outer = TRUE, cex = 2)

--sundar



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 08 06:46:29 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:21 EST