I’m trying to remove the white space around some maps that I am making in tmap. I use tmap_grob()
to convert the map to then combine with many others using ggarrange()
but this leaves a ton of white space around each map instead of plotting them next to each other nicely.
Map2023<- tm_shape(r.m["var1.pred"],bbox = bbox_new) +
tm_raster(n=5,palette = MyPalette, title="Predicted density", breaks = c(0.0, 10 ,100, 1000, 10000, 100000),legend.show = FALSE) +
tm_shape(sp2023) + tm_dots(col="Test",size=0.03, palette="red",legend.show = FALSE) +
tm_legend(legend.outside=TRUE) + tm_shape(bathy2) +tm_borders(lwd = 1, col = "black") +
tm_layout(title="2023",title.position = c('center', 'top'), frame = F)
Map2023<- tmap_grob(Map2023)