[R] Plotting text on a graph

Erin Hodgess hodgess at gator.dt.uh.edu
Mon Oct 23 22:38:48 CEST 2006


Hi Daniel:

Here is a sample code that I have used:


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 = 1.5)

And this will do the trick.

Hope this helps!

Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodgess at gator.uhd.edu



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.



More information about the R-help mailing list