Hi Rich,

bit confused what your asking.
are you looking for the pylab API savefig
http://matplotlib.sourceforge.net/matplotlib.pyplot.html#-savefig

or you asking how to convert your variable+.png into a filename?
is your variable a number?, string?

for count in range(3):
    count = count +1
    fname = 'MyPlot_%d.png' %count
    print fname

mystr = 'MyFirstPlot'
fname = '%s.png' % mystr
print fname

results in
 >python -u "test.py"
MyPlot_1.png
MyPlot_2.png
MyPlot_3.png
MyFirstPlot.png
 >Exit code: 0


pylab.savefig('%s.png'% curVar)
   or
pylab.savefig('%d.png'% curVar)


Does anything here help?
Steve






Rich Shepard wrote:
>    I want to save plots programmatically, using a variable + .png as the
> filename. I don't see an example of the proper syntax, and my
> trial-and-error approach hasn't yielded a solution, either.
>
>    If I want to write
>
>       pylab.save(curVar.png)
>
> where 'curVar' is a variable assigned programmatically, how do I correctly
> write it?
>
> Rich
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to