how to export tm object without chart borders
Asked Answered
K

1

9

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

Kedge answered 22/12, 2016 at 23:9 Comment(1)
By any chance we can set the background to be transparent too?Kedge
D
12

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)
Decasyllabic answered 22/12, 2016 at 23:20 Comment(1)
Excellent. Thank you! I am not very familiar with tmapKedge

© 2022 - 2024 — McMap. All rights reserved.