title: Use savefig in Python with string and iterative index in the name
body: <p>I need to use the "savefig" in Python to save the plot of each iteration of a while loop, and I want that the name i give to the figure contains a literal part and a numerical part. This one comes out from an array or is the number associated to the index of iteration. I make a simple example:</p>
  
  <pre><code># index.py
  
  from numpy import *
  from pylab import *
  from matplotlib import *
  from matplotlib.pyplot import *
  import os
  
  x=arange(0.12,60,0.12).reshape(100,5)
  y=sin(x)
  
  i=0
  
  while i&lt;99
    figure()
    a=x[:,i]
    b=y[:,i]
    c=a[0]
    plot(x,y,label='%s%d'%('x=',c))
  
    savefig(#???#)      #I want the name is: x='a[0]'.png
                        #where 'a[0]' is the value of a[0]
  </code></pre>
  
  <p>thanks a lot.</p>