title: How to create a map with transparent background?
body: <p>I'm trying to create and save a map with transparent background instead of a white (or any other color) one using the R package <code>tmap</code>.</p>
  
  <p>Apart from what's in the example below, I tried using <code>bg.color = "transparent"</code>, <code>bg.color = NA</code>, and <code>bg.color = NULL</code> in both <code>tmap_options</code> and <code>tm_layout</code>.</p>
  
  <p>Version info:</p>
  
  <ul>
  <li><code>tmap</code>: 2.2</li>
  <li><code>tmaptools</code>: 2.0-1</li>
  </ul>
  
  <pre><code>library(tmap)
  data("World")
  
  tmap_options (bg.color = "#00000000", basemaps.alpha = 0)
  map &lt;- tm_shape(World) +
    tm_polygons("HPI") +
    tm_layout (frame = FALSE, bg.color = "#00000000")
  
  tmap_save (map, filename = "~/test.png")
  </code></pre>
  
  <p>Am I doing something wrong or is this simply a limitation of the package? Thanks a lot!</p>