简体   繁体   中英

Turn on x-axis and y-axis values when printing several rasters leveplot R

I would like to turn on the x and y-axis values (ie label the empty tick marks) in the following example:

library(rasterVis)
s <- stack(replicate(6, raster(matrix(runif(100), 10))))
levelplot(s, layout=c(3, 2), index.cond=list(c(1, 3, 5, 2, 4, 6)))

In the actual data, I will be labelling the empty tickmarks using lat and lon.

Thanks for your help.

library(rasterVis)
s <- stack(replicate(6, raster(matrix(runif(100), 10))))

x.scale <- list(font=10,
                fontface=2,
                alternating=1)

y.scale <- list(font=10,
                fontface=2,
                alternating=1)

levelplot(s, layout=c(3, 2), index.cond=list(c(1, 3, 5, 2, 4, 6)),
  scales = list(x=x.scale, y=y.scale))

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM