By default legend is plot right side and I want to change it to bottom of plot.

levelplot(CHL1, xlim=c(30,130), ylim=c(-20,30),
          xlab="", ylab="", margin=FALSE, col.regions=pal,
          at=seq_along(brks), colorkey=ckey) +
    layer(sp.polygons(msk, fill='black', col='transparent'))
  • This is not related to GIS directly and should be asked on Stackoverflow
    – Curlew
    Commented Oct 10, 2014 at 7:31

1 Answer 1


Try colorkey=list(space="bottom"):

f <- system.file("external/test.grd", package="raster")
r <- raster(f)
levelplot(r, margin=FALSE, colorkey=list(space="bottom"))


Not the answer you're looking for? Browse other questions tagged or ask your own question.