[R] Plotting Text on a graph

David Barron mothsailor at googlemail.com
Mon Oct 23 22:06:19 CEST 2006


Have you thought of using split.screen instead?

Something like might work for you:

split.screen(c(1,1))
split.screen(c(3,4), 1)
for (i in 1:12) {
   screen(i+1)
   par(mar=c(2,2,4,2))
   plot(1:20,rnorm(20),xlab="",ylab="")
}
screen(1)
title("Overall title")


On 23/10/06, Dan Chan <dchan at gfc.state.ga.us> wrote:
> Hi,
>
>
>
> 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.
>
>
>
> # FM10 by Month/ Export the plot to Wash2005FM10.png
>
> png(file="Wash2005FM10.png",bg="white")
>
> par(mfrow = c(3,4))
>
> # Plot 12 Month of OFM10, FFM10
>
> for(i in 1:12) {
>
> Temp <- subset (Wash2005, MM == i)
>
> plot (Temp$FM10.1,
> Temp$FM10,main=month.name[i],xlim=c(5,25),ylim=c(5,25))
>
> }
>
> text(10,10, "Overall Title")  'This will plot "Overall Title" at
> coordinate (10,10) on the last graph, and so it is not what I want.
>
> dev.off()
>
>
>
> Thank you.
>
>
>
> Daniel Chan
>
> Meteorologist
>
> Georgia Forestry Commission
>
> P O Box 819
>
> Macon, GA
>
> 31202
>
> Tel: 478-751-3508
>
> Fax: 478-751-3465
>
>
>
>
>         [[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.
>


-- 
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP



More information about the R-help mailing list