title: Conveniently exporting high resolution map with sensible font and legend sizes
body: <p>I'm using the code below to create a high resolution map:</p>
  
  <pre><code># Data sourcing -----------------------------------------------------------
  
  # Download an read US state shapefiles
  tmp_shps &lt;- tempfile(); tmp_dir &lt;- tempdir()
  download.file("http://www2.census.gov/geo/tiger/GENZ2014/shp/cb_2014_us_state_20m.zip",
                tmp_shps)
  unzip(tmp_shps, exdir = tmp_dir)
  
  # Libs
  require(rgdal); require(ggplot2)
  
  # Read
  us_shps &lt;- readOGR(dsn = tmp_dir, layer = "cb_2014_us_state_20m")
  # Prepare data set for ggplot2
  us_shps_frt &lt;- fortify(us_shps, region = "NAME")
  
  # Fit map -----------------------------------------------------------------
  
  # Lib
  require(ggmap)
  
  # Get box for the
  bbox &lt;- make_bbox(lon = long, lat = lat,
                    data = us_shps_frt[grep("South", us_shps_frt$id),],
                    f = 0.5)
  map_backgr  &lt;- get_map(bbox, maptype = "roadmap", zoom = 5,
                         source = "google", scale = 2, messaging = TRUE)
  map_backgr &lt;- ggmap(map_backgr, extent = "normal", maprange = FALSE)
  
  # Libs
  require(grid)
  
  
  # Generate and export -----------------------------------------------------
  
  exp_map &lt;- map_backgr +
    geom_polygon(data = us_shps_frt[grep("South", us_shps_frt$id),],
                 aes(x = long, y = lat, group = group,
                     fill = id)) +
    coord_equal() +
    ggtitle("Odd Map with Background") +
    theme_map() +
    theme(legend.background = element_rect(colour = 'black'),
          plot.title = element_text(face = 'bold', size = 7),
          legend.position = c(0.8,0),
          legend.text = element_text(size = 5),
          legend.title = element_text(size = 5, face = 'bold'),
          legend.background = element_rect(size = 0.1, colour = 'black',
                                           linetype = 'solid'),
          plot.margin = unit(rep(5,4),"mm"))
  
  
  ## Export
  ggsave(filename = "exp_map.png",
         plot = exp_map, width = 7, height = 7, units = 'cm',
         scale = 2, dpi = 600)
  </code></pre>
  
  <p>The code generates this map:</p>
  
  <p><a href="https://i.stack.imgur.com/6dXv4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6dXv4.jpg" alt="Ugly map"></a></p>
  
  <p>I'd like to change the following:</p>
  
  <ol>
  <li>Outline line around the legend - I attempted to control it via the <code>theme</code> settings but the legend outline is still ridiculously big.</li>
  <li>Removing the white margins around the text, why despite <code>plot.margin = unit(rep(5,4),"mm")</code> setting added to the <code>theme</code> the plot is surrounded by an ample white margin?</li>
  </ol>