title: Setting the same axis limits for all subplots in matplotlib
body: <p>This problem seems simple enough, but I can't find a pythonic way to solve it. I have several (four) subplots that are supposed to have the same <code>xlim</code> and <code>ylim</code>. Iterating over all subplots à la</p>
  
  <pre><code>f, axarr = plt.subplots(4)
  for x in range(n):
      axarr[x].set_xlim(xval1, xval2)
      axarr[x].set_ylim(yval1, yval2)
  </code></pre>
  
  <p>isn't the nicest way of doing things, especially for 2x2 subplots – which is what I'm actually dealing with. I'm looking for something like <code>plt.all_set_xlim(xval1, xval2)</code>.</p>
  
  <p>Note that I don't want anything else to change (ticks and labels should be controlled separately).</p>
  
  <p>EDIT: I'm using the <code>plt.subplots(2, 2)</code> wrapper. Following dienzs answer, I tried <code>plt.subplots(2, 2,sharex=True, sharey=True)</code> – almost right, but now the ticks are gone except for the left and bottom row.</p>