0
$\begingroup$

I want to extract PNG files and name them depending on the dummy variable of a loop. For example, starting from

Do[Export["image.png", ListPlot[Table[i, {i, k}]]], {k, 1, 2}],

I would like to export two files named "image-1.png", "image-2.png" corresponding to ListPlot[Table[i, {i, 1}]] and ListPlot[Table[i, {i, 2}]], respectively.

$\endgroup$
0

1 Answer 1

1
$\begingroup$

How about

Do[Export["image-" <> ToString[k] <> ".png", ListPlot[Table[i, {i, k}]]], {k, 1, 2}],
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.