Re: How to export a lot of different plots?
- To: mathgroup at smc.vnet.net
- Subject: [mg93537] Re: How to export a lot of different plots?
- From: yiping.boston at gmail.com
- Date: Thu, 13 Nov 2008 21:07:45 -0500 (EST)
- References: <gfgqg2$djr$1@smc.vnet.net> <gfh3d0$g24$1@smc.vnet.net>
On Nov 13, 7:34 pm, Albert Retey <a... at gmx-topmail.de> wrote:
> yiping.bos... at gmail.com schrieb:> I need to generates a lot of plots, but=
I don't know are there any
> > convenient ways to output my plot with different file names, such as
> > plot001.jpg.
> > Can I just out put the plot with Export["f[i].jpg"] with the loop
> > index i? It seems that I can't run the label in the export file name.
> > The loop doesn't recognize the index i , and treat it as a letter.
>
> If you have a list of plots, you can use something like this:
>
> Do[
> Export["plot"<>ToString[i]<>".jpg",plot[[i]]],
> {i,1,Length[plot]}
> ]
>
> to use a number in a filename, you need to convert it to a string and
> StringJoin (thas the <> in the above code) it with the rest of the filena=
me.
>
> hth,
>
> albert
Thanks Albert, the method you provided really helps me a lot. Now I
know how to convert the index to string.
And the method you provided works perfectly for me:)
Best,
Yiping