Hi! How does one change the background color of the map-panel in spplot()? Example: library(sp) data(meuse.grid) gridded(meuse.grid) = ~x+y spplot(meuse.grid, "part.a") How would I get another background-color for the map-panel (but not for the whole plot) here? Thank you! Marcel
I would guess it works the same as for standard trellis graphs. Googleing: trellis R change panel background gives you links to some discussions about these issues. HTH Jannis On 03/05/2011 01:06 PM, Marcel J. wrote:> Hi! > > How does one change the background color of the map-panel in spplot()? > > Example: > > library(sp) > > data(meuse.grid) > gridded(meuse.grid) = ~x+y > > spplot(meuse.grid, "part.a") > > How would I get another background-color for the map-panel (but not > for the whole plot) here? > > Thank you! > > Marcel > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Thank you, Jannis! I came as far as that: library(sp) data(meuse.grid) gridded(meuse.grid) = ~x+y spplot(meuse.grid, zcol = "part.a", sp.layout= list("panel.fill", "grey")) but here not only the background is grey. Instead the whole panel turns grey... Help would be appreciated! Thank you, Marcel Am 2011-03-05 15:23, schrieb Jannis:> I would guess it works the same as for standard trellis graphs. > Googleing: > > trellis R change panel background > > gives you links to some discussions about these issues. > > > > > HTH > Jannis > > > On 03/05/2011 01:06 PM, Marcel J. wrote: >> Hi! >> >> How does one change the background color of the map-panel in spplot()? >> >> Example: >> >> library(sp) >> >> data(meuse.grid) >> gridded(meuse.grid) = ~x+y >> >> spplot(meuse.grid, "part.a") >> >> How would I get another background-color for the map-panel (but not >> for the whole plot) here? >> >> Thank you! >> >> Marcel >> >> ______________________________________________ >> R-help at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > >
Marcel, Here is one way: spplot(meuse.grid, zcol = "part.a", par.settings list(panel.background=list(col="grey"))) ## trellis.par.get() trellis.par.get()$panel.background Regards, Mark.> On 03/05/2011 01:06 PM, Marcel J. wrote: >> Hi! >> >> How does one change the background color of the map-panel in spplot()? >> >> Example: >> >> library(sp) >> >> data(meuse.grid) >> gridded(meuse.grid) = ~x+y >> >> spplot(meuse.grid, "part.a") >> >> How would I get another background-color for the map-panel (but not >> for the whole plot) here? >> >> Thank you! >> >> Marcel-- View this message in context: http://r.789695.n4.nabble.com/Change-panel-background-color-in-spplot-tp3336563p3336769.html Sent from the R help mailing list archive at Nabble.com.