title: Plotting map on a plot using ggplot
body: <p>If I want to plot a map on plot, I do this </p>
  
  <pre><code>library(ggplot2)
  library(sf)
  library(cowplot)
  library(gridExtra)
  library(raster)
  
  df &lt;- data.frame(x = 1980:1999, y = sample(1:20, 20, replace = T))
  shp.dat &lt;- getData('GADM', country='FRA', level=1)
  
  shp.dat &lt;- shp.dat %&gt;% st_as_sf()
  
  p &lt;- ggplot(df, aes(x = x, y = y)) + geom_line() + ylim(0, 100)
  p.shp &lt;- ggplot() +  
          geom_sf(data = shp.dat, fill = ifelse(shp.dat$ID_1 == 1,"red", "grey")) 
  inset_map &lt;- ggdraw() + draw_plot(p, 0, 0, 1, 1) + draw_plot(p.shp, 0.5, 0.52, 0.5, 0.4) 
  inset_map
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/SOQgd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SOQgd.jpg" alt="enter image description here"></a></p>
  
  <p>Now I have four plots which I have plotted like this</p>
  
  <pre><code>  df &lt;- data.frame(x = 1980:1999, 
                   y1 = sample(1:20, 20, replace = T), 
                   y2 = sample(1:20, 20, replace = T), 
                   y3 = sample(1:20, 20, replace = T), 
                   y4 = sample(1:20, 20, replace = T))
  
  
  p1 &lt;- ggplot(df, aes(x = x, y = y1)) + geom_line() + ylim(0, 100)
  p2 &lt;- ggplot(df, aes(x = x, y = y2)) + geom_line() + ylim(0, 100)
  p3 &lt;- ggplot(df, aes(x = x, y = y3)) + geom_line() + ylim(0, 100)
  p4 &lt;- ggplot(df, aes(x = x, y = y4)) + geom_line() + ylim(0, 100)
  
  pp &lt;- grid.arrange(p1, p2, p3, p4, ncol = 2)
  </code></pre>
  
  <p>For each plot, I want to add the map as an inset   </p>
  
  <pre><code>inset_map &lt;- ggdraw() + draw_plot(pp, 0, 0, 1, 1) + draw_plot(p.shp, 0.5, 0.52, 0.5, 0.4)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/TgUo7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TgUo7.jpg" alt="enter image description here"></a></p>
  
  <p>How can I show the map as an inset in each plot separately?    </p>