[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-geo
Subject:    Re: [R-sig-Geo] Modify spplot frame borders, padding and font
From:       Zia Ahmed <zua3 () cornell ! edu>
Date:       2012-05-31 12:44:08
Message-ID: 4FC76798.7030702 () cornell ! edu
[Download RAW message or body]

Hi Iain,

par.settings is a not attribute of spplot, it is an attribute of lattice graph. It \
works fine with ssplot. See the following examples. Thanks, zia

library(lattice)

library(gstat)
data(meuse.grid)

gridded(meuse.grid) = ~x+y
names(meuse.grid)
spplot(meuse.grid[4],main = list("Soil types",cex=1.5),
par.settings=list(axis.line=list(col=NA)))

On 5/31/2012 3:17 AM, Edzer Pebesma wrote:
> 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@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@r-project.org<mailto:R-sig-Geo@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@cornell.edu<mailto:zua3@cornell.edu>
> > 
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@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@cornell.edu



	[[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic