title: Autonumbering figures in R in sequence
body: <p>I have a function for generating 8 ggplot/ggiraph maps. I want to number the figures from 8 to 16 in the sequence they are generated. I've attempted to build a function for tagging the figures, to no avail.</p>
  <pre><code>#Snippet of Map Function 
  demozipfx &lt;- function(x) {
    out &lt;- ggplot(data = x) +
      geom_sf_interactive(aes(geometry = geometry), fill = &quot;grey80&quot;, color = &quot;white&quot;) +
      geom_sf_interactive(aes(fill = as.numeric(rate), tooltip= tooltip), 
        data_id= zip),
        colour = &quot;white&quot;)+
      geom_sf(
        data = county.simp,
        fill = NA,
        color= &quot;grey20&quot;,
        lwd = 1) +
      scale_fill_viridis_c_interactive(
        name = &quot;% Population Fully\nVaccinated&quot;,
        aesthetics = &quot;fill&quot;,
        option = &quot;D&quot;,
        direction = -1,
        na.value = &quot;grey80&quot;,
        labels = percent)  +              
      labs(title = title)) +
      theme(plot.title = element_text(hjust = 0.5))
    return(out)
  }
  
  #output 
  zipdemomaps.l &lt;- lapply(zip.demo.mapdat, demozipfx)
  
  zipdemomaps &lt;- ggiraph(ggobj= plot_grid(plotlist= zipdemomaps.l[1:8], nrow=4), width_svg = 12, height_svg = 20)
  </code></pre>