title: Saving figures in a loop
body: <p>I don't know if this is possible and I hope to acurally portray what I wish to accomplish. </p>
  
  <p>Say we have:</p>
  
  <pre><code>from pylab import *
  import matplotlib.pyplot as plt
  %matplotlib inline
  
  fig = plt.figure(figsize=(10,10))
  
  y = 2
  
  for x in xrange(0,5):
      value = [1,int(y)]
      plt.plot(value)
      plt.savefig("value" + y + ".png")
      y+=1
  </code></pre>
  
  <p>So my goal here is to get 5 plots (or I think this would give me 6 plots), but I want them to each save with different names so they don't overwrite each time it goes through the loop. Is this possible? </p>
  
  <p>Note: The numbers and values in this example are arbitrary. My hope is just to plot in a loop like this and have a dynamic method to save the name of the figure.</p>