4

I want to remove the box frame in my "levelplot" figure for raster data sets. Don't know how to do it.

library(raster)
library(rasterVis)

f <- system.file("external/test.grd", package="raster")
r <- raster(f)
s <- stack(r, r+500, r-500)
levelplot(s, contour=TRUE)
levelplot(s)
levelplot(s,box=FALSE,axes=FALSE) # It doesn't work.
jbaums
  • 27,115
  • 5
  • 79
  • 119
Jian Zhang
  • 1,173
  • 5
  • 15
  • 20

1 Answers1

11

[Edit: Figures added]

What you want to achieve is described in the last example of ?wireframe

levelplot(s, contour = TRUE, par.settings = list(axis.line = list(col = "transparent")), 
          scales = list(col = "black"))`

Box frame removed

If you want to remove strip background and color:

levelplot(s, contour=TRUE, par.settings = list(axis.line = list(col = "transparent"), 
          strip.background = list(col = 'transparent'), 
          strip.border = list(col = 'transparent')), 
          scales = list(col = "black"))`

Box frame, strip background and color removed

  • 2
    hi this is really useful but for me the axis ticks are being removed, using the exact code you have used, any idea why? thanks – Sam Mar 22 '16 at 13:19