[R-sig-Geo] Modify spplot frame borders, padding and font

Edzer Pebesma edzer.pebesma at uni-muenster.de
Thu May 31 09:17:12 CEST 2012


library(lattice)
trellis.par.set(axis.line=list(col=NA))
library(sp)
loadMeuse()
spplot(meuse.grid[1])

takes away the border, but not only around the map area, also around the
legend colour block.

On 05/30/2012 10:18 PM, Dillingham, Iain wrote:
> Thank you for the prompt reply. Forgive me, but how did you know that par.settings was an attribute to spplot? I'm struggling with interpreting the documentation. For example, if I wish to remove the outline and background color from each frame title, where would I look for the appropriate parameters and values?
> 

AFAICS, par.settings does nothing in the code fragment below.

The spplot documentation says:

Description:

     Lattice (trellis) plot methods for spatial data with attributes

(and much later:)

     for useful values see the appropriate documentation of xyplot and
     levelplot.

so reading into how lattice plots work, e.g. modifying parameters with
trellis.par.set, or reading the documentation of xyplot and levelplot in
package lattice might help. It assumes that the words "lattice" and
"trellis" ring a bell.


> Thank you once again,
> 
> Iain
> ________________________________________
> From: Zia Ahmed [zua3 at cornell.edu]
> Sent: 30 May 2012 20:08
> To: Dillingham, Iain; sig-geo
> Subject: Re: [R-sig-Geo] Modify spplot frame borders, padding and font
> 
> You can add following line to get a map without frame.
> par.settings=list(axis.line=list(col=NA))
> For tittle,
> main=list("(a) tittle",cex=.6)
> For size and space between frames (for nine frames):
> windows(width=5.5, height=8)
> tiff( file="Fig.tif",width=5.5, height=8,units = "in", pointsize = 12, res=1600,
> restoreConsole = T,compression =  "lzw",bg="transparent")
> 
> print(a,position = c(0.05,0.5,1,1),split=c(1,1,4,2), more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(b,position = c(0.15,0.5,1,1),split=c(2,1,4,2),more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(c,position = c(0.45,0.5,1,1), split=c(3,1,4,2), more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(d,position = c(0.05,0.5,1,0.65),split=c(1,1,4,2), more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(e,position = c(0.15,0.5,1,0.65),split=c(2,1,4,2),more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(f,position = c(0.45,0.5,1,0.65), split=c(3,1,4,2), more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(g,position = c(0.05,0.5,1,0.30),split=c(1,1,4,2), more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(h,position = c(0.15,0.5,1,0.30),split=c(2,1,4,2),more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(i,position = c(0.45,0.5,1,0.30), split=c(3,1,4,2), more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(j,position = c(0.05,0,1,0.15),split=c(1,1,4,2), more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(k,position = c(0.15,0,1,0.15),split=c(2,1,4,2),more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> print(l,position = c(0.45,0,1,0.15), split=c(3,1,4,2), more=TRUE,panel.width=list(1.5, "inches"),panel.height=list(1.5, "inches"))
> dev.off()
> 
> On 5/30/2012 2:55 PM, Dillingham, Iain wrote:
> 
> Hello everyone,
> 
> I have used spplot to draw six small-multiple choropleth maps of London. Although I am happy with the result, I would like to recolour (and potentially remove) the outline from each frame; to add some padding between each map and its containing frame; and finally to change the font used to display the heading in each frame.
> 
> I have searched the documentation. However, I am new to R and I have been unable to uncover the mechanism that would allow me to modify these attributes. Any assistance would be gratefully received!
> 
> Many thanks,
> 
> Iain
> 
> --
> Iain Dillingham
> School of Informatics
> City University London
> EC1V 0HB
> http://www.soi.city.ac.uk/~abhm372/
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org<mailto:R-sig-Geo at r-project.org>
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 
> 
> 
> --
> ---------------------
> Zia Ahmed, PhD
> Research Associate
> Department of Crop and Soil Sciences
> 1002 Bradfield Hall, Cornell University
> Ithaca, NY 14853-4203
> t. 607.255.9387
> f. 607.255.3207
> email zua3 at cornell.edu<mailto:zua3 at cornell.edu>
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list