I am looking for help changing fonts and fontcolor for sp.text labels on an attached map. To avoid overlapping labels and improve readability.
The map was prepared as shown below. If necessary, you can download spatial information about the 'mymap' plugins here .
trellis.par.set () does not solve my problem, am I using it incorrectly?
library(sp)
library(latticeExtra)
sp.label <- function(x, label) {list("sp.text", coordinates(x), label)}
NUMB.sp.label <- function(x) {sp.label(x, as.vector(x@data$NUMB))}
make.NUMB.sp.label <- function(x) {do.call("list", NUMB.sp.label(x))}
tps <- list(fontsize=list(text=5), fontcolor=list(text="green"))
trellis.par.set(tps)
spplot(mymap, "indic",
col.regions=c("#D3D3D3","#A9A9A9"),
sp.layout = make.NUMB.sp.label(mymap),
cex = 0.5,
bg = "white", col="light grey", border="light grey")

source
share