[R-sig-Geo] contour lines on a plot

Maxime Pauwels Maxime.Pauwels at univ-lille1.fr
Tue Jan 20 11:16:37 CET 2009


Dear Virgilio and José,

Congratulations for the way you succeed in putting contourline at the 
good place, although I'm not sure I understood the solution.
I'm almost able to draw myplot... but not yet.
The problem is that I can not use contourlines on a dataframe. I attache 
my datafile to help you to see what it looks like.
I tried to use contour instead of contourLines but it didn't worked.

Many thanks,

max

Virgilio Gomez Rubio a écrit :
> Hi,
> El lun, 19-01-2009 a las 22:19 +0100, José Manuel Blanco Moreno
> escribió:
>   
>> Just a doubt... there seems that the contours are not shifted but 
>> "mirrored" (flipped) along an horizontal line?
>>     
>
> Very well spotted!!
>
> The right code should be as follows (the change is in the definition of
> 'spvolcano'):
>
> library(maptools)
>
> x <- 10*1:nrow(volcano)
> y <- 10*1:ncol(volcano)
> clv<-contourLines(x, y, volcano)
>
> res <- ContourLines2SLDF(clv)
>
> grd<-GridTopology(c(0,0), c(10, 10), dim(volcano))
> spvolcano<-SpatialGridDataFrame(grd, 
>    data.frame(altitude=as.vector((volcano[,ncol(volcano):1]))))
>
> spplot(spvolcano, sp.layout=list(list("sp.lines", res)) )
>
>
>
> Best,
>
> Virgilio
>
>
>   


-- 
Maxime Pauwels
Researcher ID: http://www.researcherid.com/rid/A-1745-2009

Laboratoire de Génétique et Evolution des Populations Végétales
http://www.univ-lille1.fr/gepv
Tel  : +33 3 20 43 40 76
Fax  : +33 3 20 43 69 79
			
«Impose ta chance, serre ton bonheur et va vers ton risque. A te regarder, ils s’habitueront.»
René Char

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Str65popK15coordK.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090120/a2e0c4a8/attachment.txt>


More information about the R-sig-Geo mailing list