[R-sig-Geo] spplot question in sp_0.9-98

Edzer Pebesma edzer.pebesma at uni-muenster.de
Tue Apr 3 21:58:07 CEST 2012


Thanks for notifying this. Removing the cex=.7 solves this, as does
replicating cex, as in

spplot(meuse, c("cadmium", "copper", "lead", "zinc"), do.log = TRUE,
key.space = "right", as.table = TRUE,
sp.layout=list(rv, scale, text1, text2, arrow),
main = "Heavy metals (top soil), ppm", cex=rep(.7,4*length(meuse)), cuts
= cuts)

This, and returning the color vector, are obviously bugs, and will be
addressed in the next version of sp.

On 04/03/2012 08:37 PM, Mauricio Zambrano-Bigiarini wrote:
> Dear List,
> 
> I just notice an strange behaviour of the 'spplot' function, and I
> would like your help to figure out if it is something related to my
> system or is something related to the 'spplot' function.
> 
> Below goes a reproducible example taken from
> http://r-spatial.sourceforge.net/gallery/ :
> 
> 
> # fig06.R multi-panel plot, scales + north arrow only in last plot.
> 
> ----------------------START-----------------------------------
> 
> library(sp)
> library(lattice) # required for trellis.par.set():
> trellis.par.set(sp.theme()) # sets color ramp to bpy.colors()
> 
> data(meuse)
> coordinates(meuse)=~x+y
> data(meuse.riv)
> meuse.sr = SpatialPolygons(list(Polygons(list(Polygon(meuse.riv)),"meuse.riv")))
> rv = list("sp.polygons", meuse.sr, fill = "lightblue")
> 
> ## multi-panel plot, scales + north arrow only in last plot:
> ## using the "which" argument in a layout component
> ## (if which=4 was set as list component of sp.layout, the river
> ## would as well be drawn only in that (last) panel)
> scale = list("SpatialPolygonsRescale", layout.scale.bar(),
> offset = c(180500,329800), scale = 500, fill=c("transparent","black"),
> which = 4)
> text1 = list("sp.text", c(180500,329900), "0", cex = .5, which = 4)
> text2 = list("sp.text", c(181000,329900), "500 m", cex = .5, which = 4)
> arrow = list("SpatialPolygonsRescale", layout.north.arrow(),
> offset = c(181300,329800),
> scale = 400, which = 4)
> cuts = c(.2,.5,1,2,5,10,20,50,100,200,500,1000,2000)
> spplot(meuse, c("cadmium", "copper", "lead", "zinc"), do.log = TRUE,
> key.space = "right", as.table = TRUE,
> sp.layout=list(rv, scale, text1, text2, arrow),
> main = "Heavy metals (top soil), ppm", cex = .7, cuts = cuts)
> 
> ----------------------END-----------------------------------
> 
> 
> After the last spplot command, I only get one point in the upper left
> figure, which is very different from the Figure 6 shown in
> http://r-spatial.sourceforge.net/gallery/
> 
> In addition, I get the following output after the spplot command:
> 
> [1] "#A714EBFF" "#6500FFFF" "#6500FFFF" "#2400FFFF" "#2400FFFF" "#2400FFFF"
>   [7] "#2400FFFF" "#2400FFFF" "#2400FFFF" "#0000DAFF" "#0000DAFF" "#0000DAFF"
>  [13] "#A714EBFF" "#2400FFFF" "#0000DAFF" "#6500FFFF" "#6500FFFF" "#6500FFFF"
>  [19] "#6500FFFF" "#A714EBFF" "#6500FFFF" "#2400FFFF" "#2400FFFF" "#0000DAFF"
>  [25] "#0000DAFF" "#0000DAFF" "#0000DAFF" "#0000DAFF" "#0000DAFF" "#0000DAFF"
>  [31] "#0000DAFF" "#0000DAFF" "#2400FFFF" "#0000DAFF" "#0000DAFF" "#2400FFFF"
>  [37] "#6500FFFF" "#6500FFFF" "#6500FFFF" "#A714EBFF" "#2400FFFF" "#0000DAFF"
>  [43] "#0000DAFF" "#0000DAFF" "#2400FFFF" "#2400FFFF" "#2400FFFF" "#0000DAFF"
>  [49] "#0000DAFF" "#2400FFFF" "#0000DAFF" "#6500FFFF" "#A714EBFF" "#A714EBFF"
>  [55] "#6500FFFF" "#6500FFFF" "#2400FFFF" "#2400FFFF" "#A714EBFF" "#6500FFFF"
>  [61] "#6500FFFF" "#6500FFFF" "#6500FFFF" "#6500FFFF" "#6500FFFF" "#6500FFFF"
>  [67] "#6500FFFF" "#000086FF" "#2400FFFF" "#2400FFFF" "#2400FFFF" "#2400FFFF"
>  [73] "#2400FFFF" "#2400FFFF" "#2400FFFF" "#2400FFFF" "#2400FFFF" "#2400FFFF"
>  [79] "#6500FFFF" "#6500FFFF" "#A714EBFF" "#A714EBFF" "#6500FFFF" "#2400FFFF"
>  [85] "#0000DAFF" "#2400FFFF" "#2400FFFF" "#2400FFFF" "#2400FFFF" "#0000DAFF"
>  [91] "#0000DAFF" "#2400FFFF" "#2400FFFF" "#000086FF" "#000086FF" "#000033FF"
>  [97] "#000086FF" "#000033FF" "#000033FF" "#000033FF" "#000086FF" "#000033FF"
> [103] "#000033FF" "#000033FF" "#000033FF" "#000033FF" "#000033FF" "#000033FF"
> [109] "#000033FF" "#000033FF" "#000033FF" "#000033FF" "#000033FF" "#000033FF"
> [115] "#000033FF" "#000033FF" "#000033FF" "#2400FFFF" "#000033FF" "#000033FF"
> [121] "#000033FF" "#000033FF" "#0000DAFF" "#2400FFFF" "#000033FF" "#000033FF"
> [127] "#000033FF" "#000033FF" "#000033FF" "#0000DAFF" "#000086FF" "#0000DAFF"
> [133] "#000033FF" "#000033FF" "#000086FF" "#000086FF" "#000086FF" "#0000DAFF"
> [139] "#0000DAFF" "#0000DAFF" "#0000DAFF" "#000086FF" "#000086FF" "#2400FFFF"
> [145] "#2400FFFF" "#2400FFFF" "#2400FFFF" "#2400FFFF" "#0000DAFF" "#0000DAFF"
> [151] "#000086FF" "#2400FFFF" "#2400FFFF" "#000086FF" "#2400FFFF" "#FF6798FF"
> [157] "#FF6798FF" "#FF6798FF" "#FF6798FF" "#E83EC1FF" "#FF6798FF" "#E83EC1FF"
> [163] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#FF6798FF"
> [169] "#E83EC1FF" "#E83EC1FF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF"
> [175] "#FF6798FF" "#FF6798FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF"
> [181] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF"
> [187] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF"
> [193] "#FF6798FF" "#FF6798FF" "#FF916EFF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF"
> [199] "#E83EC1FF" "#FF6798FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF"
> [205] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#FF916EFF" "#FF916EFF" "#FF916EFF"
> [211] "#FF6798FF" "#E83EC1FF" "#E83EC1FF" "#FF6798FF" "#FF6798FF" "#FF6798FF"
> [217] "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF"
> [223] "#E83EC1FF" "#FF6798FF" "#E83EC1FF" "#E83EC1FF" "#FF6798FF" "#E83EC1FF"
> [229] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#FF6798FF"
> [235] "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#E83EC1FF" "#E83EC1FF"
> [241] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF"
> [247] "#E83EC1FF" "#E83EC1FF" "#A714EBFF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF"
> [253] "#E83EC1FF" "#E83EC1FF" "#A714EBFF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF"
> [259] "#E83EC1FF" "#E83EC1FF" "#A714EBFF" "#A714EBFF" "#E83EC1FF" "#E83EC1FF"
> [265] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF"
> [271] "#E83EC1FF" "#E83EC1FF" "#FF6798FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF"
> [277] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#A714EBFF" "#A714EBFF"
> [283] "#A714EBFF" "#E83EC1FF" "#E83EC1FF" "#A714EBFF" "#E83EC1FF" "#A714EBFF"
> [289] "#A714EBFF" "#E83EC1FF" "#E83EC1FF" "#A714EBFF" "#E83EC1FF" "#E83EC1FF"
> [295] "#E83EC1FF" "#E83EC1FF" "#A714EBFF" "#A714EBFF" "#E83EC1FF" "#E83EC1FF"
> [301] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#A714EBFF" "#A714EBFF"
> [307] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#FFBB44FF" "#FFBB44FF"
> [313] "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FF916EFF"
> [319] "#FF916EFF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FFBB44FF" "#FF916EFF"
> [325] "#FF916EFF" "#FFBB44FF" "#FF916EFF" "#FF916EFF" "#FFBB44FF" "#FFBB44FF"
> [331] "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FF6798FF" "#FF6798FF" "#FF6798FF"
> [337] "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF"
> [343] "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF916EFF" "#FFBB44FF"
> [349] "#FFBB44FF" "#FFBB44FF" "#FF916EFF" "#E83EC1FF" "#FF6798FF" "#FF6798FF"
> [355] "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FF916EFF" "#FF916EFF" "#FF916EFF"
> [361] "#FF6798FF" "#FF916EFF" "#FFBB44FF" "#FFE51AFF" "#FFBB44FF" "#FFBB44FF"
> [367] "#FF916EFF" "#FFBB44FF" "#FFE51AFF" "#FFBB44FF" "#FFBB44FF" "#FF916EFF"
> [373] "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FFBB44FF" "#E83EC1FF"
> [379] "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF"
> [385] "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF"
> [391] "#FFBB44FF" "#FFBB44FF" "#FF916EFF" "#FF916EFF" "#FF6798FF" "#FF916EFF"
> [397] "#FFBB44FF" "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FFBB44FF"
> [403] "#FFBB44FF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF"
> [409] "#FF6798FF" "#FF6798FF" "#FF6798FF" "#E83EC1FF" "#FF6798FF" "#E83EC1FF"
> [415] "#FF6798FF" "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#FF6798FF" "#FF6798FF"
> [421] "#FF6798FF" "#E83EC1FF" "#E83EC1FF" "#FF6798FF" "#FF6798FF" "#FF6798FF"
> [427] "#FF6798FF" "#FFBB44FF" "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF6798FF"
> [433] "#FFBB44FF" "#FFBB44FF" "#FF6798FF" "#FF6798FF" "#E83EC1FF" "#E83EC1FF"
> [439] "#FF916EFF" "#FF916EFF" "#E83EC1FF" "#FF6798FF" "#FF6798FF" "#E83EC1FF"
> [445] "#E83EC1FF" "#E83EC1FF" "#E83EC1FF" "#FF6798FF" "#FF916EFF" "#FF6798FF"
> [451] "#FF6798FF" "#FF6798FF" "#FF6798FF" "#FF916EFF" "#FF916EFF" "#FF916EFF"
> [457] "#FF916EFF" "#FFBB44FF" "#FF6798FF" "#FF6798FF" "#E83EC1FF" "#FF916EFF"
> [463] "#FF916EFF" "#FF6798FF" "#FF916EFF" "#FFFF60FF" "#FFFF60FF" "#FFE51AFF"
> [469] "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF"
> [475] "#FF916EFF" "#FF916EFF" "#FFBB44FF" "#FFFF60FF" "#FFE51AFF" "#FFBB44FF"
> [481] "#FFFF60FF" "#FFE51AFF" "#FFE51AFF" "#FFE51AFF" "#FFFF60FF" "#FFE51AFF"
> [487] "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FF916EFF" "#FF916EFF" "#FFBB44FF"
> [493] "#FF916EFF" "#FFBB44FF" "#FF916EFF" "#FFBB44FF" "#FF916EFF" "#FFBB44FF"
> [499] "#FF916EFF" "#FFBB44FF" "#FFBB44FF" "#FFE51AFF" "#FFE51AFF" "#FFE51AFF"
> [505] "#FFFF60FF" "#FFBB44FF" "#FF916EFF" "#FF916EFF" "#FFBB44FF" "#FFE51AFF"
> [511] "#FFE51AFF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF"
> [517] "#FFE51AFF" "#FFFF60FF" "#FFFF60FF" "#FFFF60FF" "#FFE51AFF" "#FFBB44FF"
> [523] "#FFE51AFF" "#FFFF60FF" "#FFFF60FF" "#FFE51AFF" "#FFE51AFF" "#FFE51AFF"
> [529] "#FFE51AFF" "#FFE51AFF" "#FFE51AFF" "#FFFF60FF" "#FF916EFF" "#FFE51AFF"
> [535] "#FFE51AFF" "#FFE51AFF" "#FFE51AFF" "#FFE51AFF" "#FFE51AFF" "#FFE51AFF"
> [541] "#FFE51AFF" "#FFE51AFF" "#FFE51AFF" "#FFFF60FF" "#FFFF60FF" "#FFFF60FF"
> [547] "#FFFF60FF" "#FFE51AFF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFE51AFF"
> [553] "#FFE51AFF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FFE51AFF" "#FFE51AFF"
> [559] "#FF916EFF" "#FFBB44FF" "#FF916EFF" "#FFBB44FF" "#FF916EFF" "#FF916EFF"
> [565] "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FFBB44FF" "#FF916EFF" "#FF916EFF"
> [571] "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FFBB44FF" "#FFBB44FF"
> [577] "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FFBB44FF" "#FFBB44FF"
> [583] "#FFE51AFF" "#FFBB44FF" "#FF916EFF" "#FF916EFF" "#FFBB44FF" "#FFE51AFF"
> [589] "#FFE51AFF" "#FFBB44FF" "#FF916EFF" "#FF916EFF" "#FF916EFF" "#FFBB44FF"
> [595] "#FFBB44FF" "#FF916EFF" "#FFBB44FF" "#FFBB44FF" "#FF916EFF" "#FF916EFF"
> [601] "#FF916EFF" "#FF916EFF" "#FFBB44FF" "#FFBB44FF" "#FFBB44FF" "#FF916EFF"
> [607] "#FF916EFF" "#FF916EFF" "#FFBB44FF" "#FFBB44FF" "#FFE51AFF" "#FFE51AFF"
> [613] "#FFE51AFF" "#FFBB44FF" "#FFBB44FF" "#FF916EFF" "#FFBB44FF" "#FFBB44FF"
> [619] "#FF916EFF" "#FFBB44FF"
> 
> -------------------
> 
> sessionInfo()
> R version 2.14.1 (2011-12-22)
> Platform: x86_64-redhat-linux-gnu (64-bit)
> 
> locale:
>  [1] LC_CTYPE=en_GB.utf8       LC_NUMERIC=C
>  [3] LC_TIME=en_GB.utf8        LC_COLLATE=en_GB.utf8
>  [5] LC_MONETARY=en_GB.utf8    LC_MESSAGES=en_GB.utf8
>  [7] LC_PAPER=C                LC_NAME=C
>  [9] LC_ADDRESS=C              LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> other attached packages:
> [1] lattice_0.20-6 sp_0.9-98
> 
> loaded via a namespace (and not attached):
> [1] grid_2.14.1  tools_2.14.1
> 
> -----------
> 
> 
> Thanks in advance for any help,
> 
> 
> Mauricio Zambrano-Bigiarini
> 

-- 
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