[R] overlay xyplot on contourplot in lattice in R

Kathy-Andrée Laplante-Albert Kathy-Andree.Laplante-Albert at UQTR.CA
Mon Jan 29 20:34:21 CET 2007



Hi everybody, 

I want to do a contourplot in lattice with my raw data overlaid on it(xyplot)
which seemed to be a very easy thing to do.

I've tried it in many ways, but I haven't succeeded at obtaining it. 

let's say x, y, and z as the variables that comes from the data frame ''ex'':

therefore my countourplot is as followed :

contourplot(z ~ x * y, cuts=550)

I would like then to overalay on it xx and yy (same variables as x and y but in
another data frame let's say ''example'')

xyplot(example$xx, example$yy)

How can I do it?

It seems I could do it with the panel.contourplot and panel.xyplot options, but
until now I haven't suceeded. I found this command that maybe could help me : 


 # contourplot
contourplot(elev ~ longitude * latitude, data = interpgrid,
   panel = function(x, y, subscripts, ...) {
      panel.contourplot(x, y, subscripts, ...)
      panel.xyplot(ortann$longitude, ortann$latitude)
   } )

however, doesn't seem to work out, and I do not know what should I write for
subscripts. I do not understand the explanation in R.

Is anyone could help me? 

Thanks a lot in advance!

I use R, version 2.4.0.

Kathy-Andrée Laplante-Albert
Étudiante à la maîtrise
Groupe de Recherche sur les Écosystèmes Aquatiques
Université du Québec à Trois-Rivières
C.P. 500, Trois-Rivières (Québec) Canada 

-------------------------------------------------
Courriel expédié via https://courriel.uqtr.ca



More information about the R-help mailing list