I would like to increase the space between the plot and the legend in tmap. Using 'legend.outside.size' works, but also changes the ratio of the entire plot. Is there a way to just move down the legend? Ideally, the spacing between the lower panels and the legend would be greater than the spacing between vertical panels.
library(tmap)
library(raster)
r <- raster::raster(matrix(runif(100), 10, 10))
s <- raster::raster(matrix(runif(100), 10, 10))
t <- raster::raster(matrix(runif(100), 10, 10))
u <- raster::raster(matrix(runif(100), 10, 10))
allrasters<-stack(r,s,t,u)
tm_shape(allrasters,is.master = TRUE) +
tm_raster (title = '',
legend.is.portrait = FALSE,
legend.format = list(text.align='center'),
style="cont",
palette = "RdBu")+
tm_layout(main.title= '',
inner.margins= c(0.0,0.0,0.0,0.0),
outer.margins = c(0,0.04,0,0),
legend.text.size = 1.5,
legend.outside = TRUE,
legend.outside.position = 'bottom',
legend.outside.size = 0.15,
legend.frame=TRUE,
legend.just = c('center','bottom'),
legend.position = c('center','BOTTOM'),
panel.labels = as.character(c(2013:2018)),
panel.label.height=1.5, panel.label.size=1.5,
frame = FALSE, frame.lwd = NA, panel.label.bg.color = NA )