[R] how to plot image() without painting a map (the background)

Ptit_Bleu ptit_bleu at yahoo.fr
Tue Mar 4 16:15:41 CET 2008


Hi, 

Thanks to ggplot2 (and to Hadley Wickham) I managed to plot some nice graphs
(not as fast as in a movie but it is ok).
One thing I am still looking for is a way to add the values on the contour
lines (like with the contour function).

I read the stat.contour help page but I haven't found my case.

Is it possible to do it or not ?

Thanks for your help.
Ptit Bleu.

-------------------------------------------------------------------------
An example of code (99,99% written by Hadley - the errors come from me) with
the essai1.txt file :
http://www.nabble.com/file/p15829412/essai1.txt essai1.txt 

library(ggplot2)
library(maps)

setwd("C:/gfs/")

lonlat1<-read.table("essai1.txt", sep=",", header=T)
names(lonlat1)<-c("longitude", "latitude", "DSWRF", "x")

france <- as.data.frame(map('france', plot=F)[c("x", "y")])
france_map <- geom_path(aes(x=x, y=y, fill=NULL), data=france)

p <- qplot(data=lonlat1, longitude, latitude, geom="tile", fill=DSWRF,
xlab="", ylab="") + 
geom_contour(aes(z = DSWRF), size=1, colour="red") + france_map

p
-- 
View this message in context: http://www.nabble.com/how-to-plot-image%28%29-without-painting-a-map-%28the-background%29-tp15546906p15829412.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list