title: Multiple `subplot2grid` in a for loop
body: <p>I am trying to plot two different sets of functions going once through a double loop. I don't know how I can ask subplot2grid to act on the second figure. </p>
  
  <pre><code>import numpy as np
  from matplotlib import pyplot as plt
  t=np.linspace(0,1,100)
  fig1=plt.figure()
  for i in range(3):
      for j in range(3):
          plt.subplot2grid((3,3),(i,j))
          plt.plot(t,np.sin((t*np.random.random()*10)))
  fig2=plt.figure()
  for i in range(3):
      for j in range(3):
          plt.subplot2grid((3,3),(i,j))
          plt.plot(t,np.cos((t*np.random.random()*10)))
  plt.show()
  </code></pre>
  
  <p>Is there any way to do this with only one loop?</p>
  
  <p><img src="https://i.stack.imgur.com/PVVCa.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/R76wR.png" alt="enter image description here"></p>