[R] main title in multi-plot

Henrik Andersson han at dmi.dk
Mon Mar 26 14:26:23 CEST 2007


Use par(oma) for outer margins and then title with outer=TRUE or mtext 
in the same way.

x<-1:100
y<-x
z<-y/x
w<-exp(z)

par(oma=c(0,0,2,0))
par(mfrow=c(2,2))
plot(y~x)
plot(z~x)
plot(w~x)
plot(z~w)
title(main="Main title",outer=T)

- Henrik

Milton Cezar Ribeiro wrote:
> Dear R-gurus,
>
> I need to print several plots into a graphic device and I would like to print out a main title.
> My code looks like 
>
> x<-1:100
> y<-x^2
> z<-y/x
> w<-exp(z)
> par(mfrow=c(2,2))
> plot(y~x)
> plot(z~x)
> plot(w~x)
> plot(z~w)
>
> Kind regards,
>
> miltinho
> Brazil
>
> __________________________________________________
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list