title: loop over array in gnuplot
body: <p><sup>This question is related to <a href="https://stackoverflow.com/q/14946530">Loop structure inside gnuplot?</a> and the <a href="https://stackoverflow.com/a/17884635">answer</a> there by <a href="https://stackoverflow.com/users/2140449/dariop">DarioP</a>.</sup></p>
  
  <p>gnuplot 4.6 introduced the do command. How can I use this to loop over an array of for example files and colors? What is the correct syntax?</p>
  
  <pre><code>colors = "red green #0000FF"
  files = "file1 file2 file3"
  
  do for [i=1:3] {
    plot files(i).".dat" lc colors(i)
  }
  </code></pre>