[R] Single Title for the Multiple plot page

Stephen Tucker brown_emu at yahoo.com
Thu May 3 13:24:49 CEST 2007


Sometimes I just overlay a blank plot and annotate with text.

par(mfrow=c(1,2), oma=c(2,0,2,0))
plot(1:10)
plot(1:10)
oldpar <- par()
par(mfrow=c(1,1),new=TRUE,mar=rep(0,4),oma=rep(0,4))
plot.window(xlim=c(0,1),ylim=c(0,1),mar=rep(0,4))
text(0.5,c(0.98,0.02),c("Centered Overall Title","Centered Subtitle"),
     cex=c(1.4,1))
par(oldpar)


--- Chuck Cleland <ccleland at optonline.net> wrote:

> Mohammad Ehsanul Karim wrote:
> > Dear List, 
> > 
> > In R we can plot multiple graphs in same page using
> > par(mfrow = c(*,*)). In each plot we can set title
> > using main and sub commands. 
> > 
> > However, is there any way that we can place an
> > universal title above the set of plots placed in the
> > same page (not individual plot titles, all i need is a
> > title of the whole graph page) as well as sib-titles?
> > Do I need any package to do so?
> > 
> > Thank you for your time.
> 
>   This is covered in a number of places in the archives and
> RSiteSearch("Overall Title") points you to relevant posts. I'm not sure
> there is an example of having both a title and subtitle, but that is
> easy enough:
> 
>  par(mfrow=c(1,2), oma=c(2,0,2,0))
>  plot(1:10)
>  plot(1:10)
>  title("Centered Overall Title", outer=TRUE)
>  mtext(side=1, "Centered Subtitle", outer=TRUE)
> 
>   You might consider upgrading to a more recent version of R.
> 
> > Mohammad Ehsanul Karim (R - 2.3.1 on windows)
> > Institute of Statistical Research and Training
> > University of Dhaka 
> > ______________________________________________
> > 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. 
> 
> -- 
> Chuck Cleland, Ph.D.
> NDRI, Inc.
> 71 West 23rd Street, 8th floor
> New York, NY 10010
> tel: (212) 845-4495 (Tu, Th)
> tel: (732) 512-0171 (M, W, F)
> fax: (917) 438-0894
> 
> ______________________________________________
> 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