I need to add logo png image to my spplot as a map element. Can tell me the way how input logo as into spplot??
This is my r code.
im <- raster("LMB_KBDI_2013-01-01.tif")
proj <- CRS('+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0')
#Plot SPPlot
mrc <- readShapePoly('E:/MRC/LMB_Country.shp', proj4string=proj)
polys <- list("sp.lines", as(mrc, "SpatialLines"), col="black")
DROUGHTcolors <- colorRampPalette(c("lightyellow","yellow","orange","red"))
north <- list("SpatialPolygonsRescale", layout.north.arrow(), offset=c(107.5,20), scale=1.5)
txt1 <- list("sp.text", c(100,9.8), "0`")
txt2 <- list("sp.text", c(102,9.8), "2`")
scale <- list("SpatialPolygonsRescale", layout.scale.bar(), offset=c(100,10), scale=2, fill=c("transparent","black"))
img.layout <- list(polys, north,txt1, txt2, scale)
CUTS1 <- c(0, 200, 400, 600, 800)
CUTS11 <- c(100, 300, 500, 700)
spplot(
im,
sp.layout=img.layout,
col.regions = DROUGHTcolors,
scales=list(draw=TRUE),
colorkey=list(
draw=TRUE, space = "right", at=CUTS1,
labels=list(
at=CUTS11,
labels=c(
"Normal","Abnormally Dry","Moderate Dry","Severe Dry"
), cex.lab= 1.5
)
),
at=CUTS1, main = list(paste("Drought Map of Lower Mekong River Basin -"), cex=2)
)