Hi,

you can also do:

library(gstat)
data(meuse)
coordinates(meuse) <- ~x+y

p1=spplot ( meuse, "zinc")
p2=spplot(meuse,"copper")
p3=spplot(meuse,"lead")
p4=spplot(meuse,"cadmium")

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,.5,0.5),more=T)
print(p4, position = c(.5,0,1,0.5))

Sam

On Tue, Jul 17, 2012 at 12:55 PM, Barry Rowlingson <
b.rowlingson@lancaster.ac.uk> wrote:

> On Tue, Jul 17, 2012 at 5:19 PM, Roosbeh Nowrouzian
> <roosbeh.nowrouzian@gmail.com> wrote:
> > Dear List members:
> >
> > While par(mfrow=c(i,j)) works for plot function, I met a problem with
> > spplot function. Even after defining e.g. par(mfrow=c(2,2)) The spplot
> > draws each figure separately.Here is an example:
> >
> > par(mfrow=c(2,2))
> >
> > data(meuse)
> > coordinates(meuse) <- ~x+y
> >
> > spplot ( meuse, "zinc")
> > spplot(meuse,"copper")
> > spplot(meuse,"lead")
> > spplot(meuse,"cadmium")
> >
> > Does any one knows how to put multiple spplot in the same page?
> >
>
> Either ditch spplot and realise that for single maps all that
> spplot(foo,"bar") is doing is essentially plot(foo,col=f(foo$bar)).
> Just write a function f to map values to colours in a palette and do
> that, with par(mfrow=c(2,2)). Also, spplots default palette is awful
> for points - you'll get white points on a white background, so don't
> use that.
>
> If you dont want to customise your maps with base graphics you need to
> dive into grid graphics, get the gridExtra package and then:
>
>  > require(gridExtra)
>  >
> grid.arrange(spplot(meuse,"zinc"),spplot(meuse,"cadmium"),spplot(meuse,"lead"),spplot(meuse,"copper"),ncol=2)
>
> Its a whole new world. Anyway, you'll probably want to do this with
> ggplot2 next...
>
> Barry
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

