Search code examples
rborderfacettmap

Remove / customize facets borders in tmap (tm_facets)


I created a plot with multiple facets, thanks to tmap (R package) and tm_facets.

I would like to remove the borders of the facets titles (i.e. the black rectangles on top of each map), but I can't figure out how.

Here is an example:

library(tmap)

data(World, NLD_muni, NLD_prov, land, metro)

current.mode <- tmap_mode("plot")

tm_shape(NLD_prov) +
  tm_polygons("gold2") +
  tm_facets(by="name")

Thanks in advance for any help.


Solution

  • you can try yo use frame.lwd = NA and optional panel.label.bg.color = NA to remove the background colour in the facetbox

        library(tmap)
    
        data(World, NLD_muni, NLD_prov, land, metro)
    
        current.mode <- tmap_mode("plot")
    
        tm_shape(NLD_prov) +
          tm_polygons("gold2") +
          tm_facets(by="name") +
          tm_layout(frame = FALSE, frame.lwd = NA, panel.label.bg.color = NA)