Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to export tm object without chart borders

Tags:

r

rgdal

tmap

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

like image 547
gemkeeper Avatar asked Dec 22 '16 23:12

gemkeeper


1 Answers

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)
like image 90
HubertL Avatar answered Nov 10 '22 18:11

HubertL