title: Subplots within for loops
body: <p>I want to put four file plots into 1 subplot figure from a loop.</p>
  
  <p>I've looped some files (four data files) to extract certain data from it (e.g. latitude, longitude and aerosol optical depth), which is correctly printed, suggesting it has successfully looped over the files and extracted what I need. When I continue the loop and just plot the results, it plots four individual figures as I haven't done subplot. </p>
  
  <p>When I implement some subplot code, it does a lot of things but not what I want. I want 1 subplot figure with 2 rows and 2 columns showing each file, not 4 subplot figures repeating just that 1 file for each subplot.</p>
  
  <p>This is my condensed code:</p>
  
  <pre><code>for lim in mlims:
     fil= ilfil + innm +'kd00' + jad +'nam'
     ln= Dataset(ilfil)
     longit = vn.variables['longitude'][:]
     latitud = vn.variables['latitude'][:] 
     ## etc .....
     aode       = var1+var2
     aod=np.squeeze(aode[:,2,:,:])
  
     lons, lats = np.meshgrid(lonitud, latatit)
     x, y = map(lons, lats)
  
     ii=[0,1,2,3]
     fig, axes = plt.subplots(nrows=4, ncols=4, figsize=(2,5))
     for ax,mon_index,lname in zip(axes.flatten(),ii, mnames):
  
  
         axis=np.arange(0+0.025,0.5+0.025,0.025)
  
         cs = ax.contourf(x,y,aod,axis,cmap='seismic',linewidths=1.)
         cbar = map.colorbar(cs)
  
         plt.title(AOD)
  
  plt.show()
  </code></pre>
  
  <p>The code outputs this: 1 is a plot of the file but I don't want the same file to repeat in one subplot figure, and 2+ is a plot</p>
  
  <p>I want it to output:</p>
  
  <p>1   1 
  1   2    - for the first file </p>
  
  <p>1   1
  1   3   - second file</p>
  
  <p>1   1
  1   4  - third</p>
  
  <p>1   1
  1   5</p>
  
  <p>What I'm trying to get is just:
  2   3
  4   5</p>