how to export tm object without chart borders

3.3k views Asked by At

I am trying to plot a map without the 'box border' around it.

Does anybody know how to work around the tmap package to not print the 'outer box border'? - not to be confused with tm_borders as it is a segment plotting the border of the polygons in the map.

Here's my example code:

tm_obj <- tm_shape(area_spdf) + 
          tm_fill(col = var, palette = "Blues", legend.show = FALSE) +
          tm_borders(col = "burlywood4", lwd = 0.25)`

save_tmap(tm = tm_obj, 
          filename = paste("plot_tm_output_", var, ".png", sep = ""))`

enter image description here

1

There are 1 answers

1
HubertL On BEST ANSWER

You can use tm_layout to specify not to draw frame:

 tm_obj <- tm_shape(area_spdf) + 
           tm_fill(col = var, palette = "Blues", legend.show = FALSE) +
           tm_borders(col = "burlywood4", lwd = 0.25) +
           tm_layout(frame = FALSE)