Hello r-users,

I feel like I'm missing something really obvious and simple to a problem that's been driving me nuts... Drawing contour-filled plots of sp objects.

For example:
> data(meuse.grid)
> coordinates(meuse.grid) = c("x", "y")
> gridded(meuse.grid) <- TRUE
> x = as(meuse.grid, "SpatialPixelsDataFrame")

Now, when I do:
> spplot(x["dist"])

I get a gridded plot with the "dist" values converted to an appropriate color.

One more step:
> spplot(x["dist"], contour=TRUE)
Now, I get the contours drawn over the gridded plots.

What I'd like is to color-fill the contours, and "hide" the grids underneath it. Even better would be if I had some control over how the contour distances are set.

I've thought about a number of way to do this, including dividing each of the current grid into equal smaller grids and then smoothing them out, and I guess repeating the process would eventually lead to a point where the gridded plots would be virtually indistinguishable from the contour plot. However, I just can't shake the notion that there's a really simple way to do this that I'm missing. I mean, the contours are already there on the map, and all I have to do is color it...

Help?

Thanks,

Jooil

#############################################
Jooil Kim, Ph.D.
School of Earth and Environmental Sciences,
Seoul National University
Gwanak Gu Shillim 9 Dong San 56-1
Seoul National Univ. Bld#501, Rm 503
Seoul, Rep. of Korea 151-742
kji2080@gmail.com
tel) 82-2-877-6741
fax) 82-2-885-7164
#############################################

	[[alternative HTML version deleted]]

