0

How do I change the vertical space between the raster and the title in a levelplot in R? For example, for an extra 2 lines of space I have tried

r <- raster::raster( matrix(runif(9),3,3) )
rasterVis::levelplot(r, margin=FALSE, main=list('My plot',line=2) )
Jordan
  • 455
  • 6
  • 21

2 Answers2

2

One simple way is to add blank lines in the title

rasterVis::levelplot(r, margin=FALSE, main=list('My plot\n'))

enter image description here

dww
  • 30,425
  • 5
  • 68
  • 111
2
rasterVis::levelplot(r, margin=FALSE, main=list('My plot',y=grid::unit(-2, "mm")))
Jordan
  • 455
  • 6
  • 21