0

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.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Rgkpdx
  • 103
  • 3

1 Answers1

1

How about

Do[Export["image-" <> ToString[k] <> ".png", ListPlot[Table[i, {i, k}]]], {k, 1, 2}],
bill s
  • 68,936
  • 4
  • 101
  • 191