[R-sig-Geo] avoid plot frame (bounding box) in spplot

Edzer Pebesma edzer.pebesma at uni-muenster.de
Thu Jul 21 21:50:32 CEST 2011


(Cc:'ing to Deepayan) -- the problem refered to earlier seems to be that in

library(sp)
loadMeuse()
spplot(meuse.grid["dist"], par.settings =
    list(axis.line = list(col =  'transparent')))

not only the frame around the plot, but also the line around the legend
disappears. AFAICS lattice:::draw.colorkey is instructed right at the
start, at:

    axis.line <- trellis.par.get("axis.line")
    axis.text <- trellis.par.get("axis.text")

to use the same line characteristics that control the plot frame.
--
Edzer


On 07/21/2011 09:36 PM, Dennis Murphy wrote:
> Hi:
> 
> Is this what you had in mind?
> 
> # library(lattice)
> spplot(meuse, zcol = 'zinc',
>            par.settings = list(axis.line = list(col = 'transparent')))
> 
> The par.settings = part comes from the graphical parameters in
> lattice. See trellis.par.get('axis.line') to get a list of the
> (default) settings; par.settings() allows you to change the defaults
> temporarily in the current call. See Chapter 7 of the Lattice book for
> more details.
> 
> Reproducible examples are a Good Thing :)
> 
> HTH,
> Dennis
> 
> On Thu, Jul 21, 2011 at 4:58 AM, Carson Farmer <carson.farmer at gmail.com> wrote:
>> Dear list,
>>
>> I'm sure there is a simple solution to my question, but I've scoured
>> the archives and tried every combination of parameters I can think of,
>> and still can't find a solution. All I want to do is 'remove' the
>> bounding box around my spplot plots. For those of you who like
>> reproducible examples, try the following:
>>
>> library(lattice)
>> data(meuse)
>> coordinates(meuse) <- ~x+y
>> spplot(meuse, zcol="zinc")
>>
>> Notice the black box around the plot (with the legend below). How can
>> I remove this bounding box?
>>
>> Thanks in advance,
>>
>> Carson
>>
>> P.S.
>>
>> sessionInfo()
>> R version 2.13.1 (2011-07-08)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>>
>> locale:
>>  [1] LC_CTYPE=en_IE.utf8       LC_NUMERIC=C
>> LC_TIME=en_IE.utf8
>>  [3] LC_COLLATE=en_IE.utf8     LC_MONETARY=C
>> LC_MESSAGES=en_IE.utf8
>>  [5] LC_PAPER=en_IE.utf8      LC_NAME=C                 LC_ADDRESS=C
>>  [8] LC_TELEPHONE=C            LC_MEASUREMENT=en_IE.utf8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] grid      stats     graphics  grDevices utils     datasets
>> methods   base
>>
>> other attached packages:
>>  [1] maptools_0.8-6  lattice_0.19-30 foreign_0.8-44  rgeos_0.1-4
>> stringr_0.4     rgdal_0.6-33
>>  [7] classInt_0.1-14 e1071_1.5-25    class_7.3-3     sp_0.9-80
>> MASS_7.3-13
>>
>> loaded via a namespace (and not attached):
>> [1] plyr_1.5.2   tools_2.13.1
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
> 
> _______________________________________________
> 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