Martin,
you can do things like this is lattice(Extra)

library(latticeExtra)
levelplot(volcano) + as.layer(contourplot(volcano))

as spplot of a SpatialPixelsDataFrame is essentially a levelplot his 
should do what you want.

Regards,
Tim



On 20/7/2012 19:22, Martin Ivanov wrote:
> Dear R users,
>
> I have the following problem. I plot a SpatialPixelsDataFrame object 
> with spplot and I need to add a contourplot
> of another spatial variable. To be more precise, I plot the 
> SpatialPixelsDataFrame of the mean precipitation over Germany with 
> coloured regions and I want to overlay the isolines of the 500, 1000 
> and 1500 m height above sea level. Of course I can plot the lines as 
> SpatialLines using the sp.layout argument to spplot, but so I lose the 
> labels on the lines. And I want the height above sea level to be 
> labelled just as it is labelled in a contour plot. Is it possible to 
> achieve that with lattice?
>
> I am still new to lattice, so I beg Your excuse in case I am asking 
> something trivial. I googled a lot and tried a lot of things, but none 
> worked. I tried with contour, it does work with Spatial objects, but 
> unfortunately contour does not seem work with lattice. And the lattice 
> equivalent contourplot does not recognise Spatial objects.
>
> I am already out of ideas. I am looking forward to Your replies. Any 
> suggestions will be appreciated.
>
> Best regards,
>
> Martin
>

-- 
#####################################
Tim Appelhans
Department of Geography
Environmental Informatics
Philipps Universität Marburg
Deutschhausstraße 12
35032 Marburg (Paketpost: 35037 Marburg)
Germany

Tel +49 (0) 6421 28-25957


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to