Re: [R] Plotting Text on a graph

From: Earl F. Glynn <efg_at_stowers-institute.org>
Date: Tue 24 Oct 2006 - 15:22:29 GMT

"Dan Chan" <dchan@GFC.STATE.GA.US> wrote in message news:43679C69FEEE9C40AC8876C0FF38EF10014FEBD7@mailsvr01.gfc.state.ga.us...

>

> I plotted 12 graphs on a page and output to a png file. I wanted to
> have an overall title for all 12 graphs. What command can I use to do
> this? Below is the code that plotted the 12 graphs in one page.

Define an "outer margin area" at the top and put your overall title there.

Find some illustrated examples of oma (outer margin area) and mar (margin area) here with mfrow/mfcol:
http://research.stowers-institute.org/efg/R/Graphics/Basics/mar-oma/index.htm

Perhaps this will get you started:

# Outer margin area (South, West, North, East).
# Default is all 0s, so ask for North oma of 2.
# Trim some of the space form regular margins (mar) too.

par(mfrow=c(3,4), mar=c(4,4.5,1,1), oma=c(0,0,2,0))

for (i in 1:12)
{
  plot(0)
}

mtext("Overall Title", NORTH<-3, line=0.5, adj=0.5,

      col="red", outer=TRUE, cex=1.2)

efg
Earl F. Glynn
Scientific Programmer
Stowers Institute for Medical Research



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 and provide commented, minimal, self-contained, reproducible code. Received on Wed Oct 25 14:09:32 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 25 Oct 2006 - 04:30:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.