[R-sig-Geo] matching shading and contour

F. De Sales fhds2000 at yahoo.com
Fri Apr 25 21:08:53 CEST 2008


    Hello everyone.
    Once again I need you help. How to make sure that
contour lines and shading match when using the command
filled.contour?
    This is my example:

P = array(0,c(10,5))
P [1,]= c(-0.0708, -0.09906,  0.2346,  0.1556,
-0.1136)
P [2,]= c(-0.1086, -0.07813,  0.4122,  0.3290,
-0.2537)
P [3,]= c(-0.0661, -0.16677,  0.5109,  0.6276,
-0.4118)
P [4,]= c(-0.0728, -0.05032,  0.2441,  0.7046,
-0.8731)
P [5,]= c(-0.0940,  0.00464,  0.0212,  0.3605,
-1.2655)
P [6,]= c(-0.2043, -0.18422, -0.1460,  0.0917,
-1.0035)
P [7,]= c(-0.2263, -0.17598,  0.0318, -0.0685,
-0.8082)
P [8,]= c(-0.3277, -0.16696,  0.2180, -0.0898,
-0.6687)
P [9,]= c(-0.3139, -0.19312,  0.4357, -0.1240,
-0.3028)
P[10,]= c(-0.1368,  0.15187,  0.1775,  0.0379,
-0.0158)
xx = seq(1,10)
yy = seq(1,5)
filled.contour(xx,yy,P,ylim=c(2,5),
   zlim=c(-1.5,1.5),nlevels=20,
   color=cm.colors,
   plot.axes = {
      contour(xx,yy,P,add=T, col="grey", ylim=c(2,5),
      zlim=c(-1.5,1.5),nlevels=20,
      drawlabels=F)
      axis(1,1:length(xx))
      axis(2,1:length(yy))
    })

    You can see that in the center of the plot the
contour lines do no match the shaded pink area.

    Any idea?
    Thank you again for your help.
    F. De Sales 


      ____________________________________________________________________________________

[[elided Yahoo spam]]




More information about the R-sig-Geo mailing list