title: Set axis for multiple plots in ggplot
body: <p>I'm working on a population pyramide that should be saved as a gif. <a href="http://flowingdata.com/2015/11/03/animated-pyramid-chart-in-r/" rel="nofollow">Kind of like in this tutorial of Flowing Data</a>, but with <code>ggplot</code> instead of <code>plotrix</code>.</p>
  
  <p>My workflow:</p>
  
  <p>1) Create a population pyramide</p>
  
  <p>2) Create multiple pyramide-plots in a <code>for</code>-loop</p>
  
  <pre><code>for (i in unique(d$jahr)) {
  
    d_jahr &lt;- d %&gt;%
      filter(jahr == i)
  
    p &lt;- ggplot(data = d_jahr, aes(x = anzahl, y = value, fill = art)) +
      geom_bar(data = filter(d_jahr, art == "w"), stat = "identity") +
      geom_bar(data = filter(d_jahr, art == "m"), stat = "identity") +
      coord_flip() +
      labs(title = paste(i), x = NULL, y = NULL)
  
    ggsave(p,filename=paste("img/",i,".png",sep=""))
  
  }
  </code></pre>
  
  <p>3) Save the plots as gif with the <code>animation</code> package</p>
  
  <p>My problem:</p>
  
  <p>All years have different values, so the x-axis have different ranges. This results in weird looks in a gif, because the center of the plots jumps to the right, to the left, to the right...</p>
  
  <p>Is it possible to fix the x-axis (in this case y-axis, because of <code>coord-flip()</code>) over multiple plots that are created independently?</p>