[R-sig-Geo] panel figure with multiple spplot objects

Paul Hiemstra p.hiemstra at geo.uu.nl
Tue Aug 12 17:56:35 CEST 2008


Hi Eelke,

You can exploit the fact that you can save spplot plots to R-objects 
like this:

library(gstat)
data(meuse)
coordinates(meuse) =~ x+y
data(meuse.grid)
gridded(meuse.grid) =~ x+y
p1 = spplot(meuse, "copper")
p2 = spplot(meuse, "zinc")
p3 = spplot(meuse.grid, "dist")
# Make a composite plot:
# see ?print.trellis for more details
print(p1, position = c(0,.5,.5,1),more=T)
print(p2, position = c(.5,.5,1,1),more = T)
print(p3, position = c(0,0,1,.5))

This method allows you to combine all lattice plots (e.g. xyplot, 
dotplot, etc) including spplot in one composite image.

cheers,
Paul


Eelke Folmer wrote:
> I am trying to make a panel-figure with multiple sp-plots. Doing par(mfrow=)
> does not work here because spplot is a wrapper for lattice (right?). I tried
> getting around this by exporting the resulting plots to jpg or tif and then
> importing it with rgdal. Due to the large size of jpg-s this is not a good
> way, even though the principle does work (for one layer of RGB). I would
> believe that this is a common operation that shouldn't be so hard if one
> only knew how. Any recommendations?
>
>
> Thanks in advance, Eelke
>
>
>  
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>   


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone: 	+31302535773
Fax:	+31302531145
http://intamap.geo.uu.nl/~paul




More information about the R-sig-Geo mailing list