manpagez: man pages & more
info gnuplot
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.11 iteration

The ‘plot‘, ‘splot‘, ‘set‘ and unset commands may optionally contain an iteration clause. This has the effect of executing the basic command multiple times, each time re-evaluating any expressions that make use of the iteration control variable. Iteration of arbitrary command sequences can be requested using the ‘do‘ command. Two forms of iteration clause are currently supported:

      for [intvar = start:end{:increment}]
      for [stringvar in "A B C D"]


      plot for [filename in "A.dat B.dat C.dat"] filename using 1:2 with lines
      plot for [basename in "A B C"] basename.".dat" using 1:2 with lines
      set for [i = 1:10] style line i lc rgb "blue"
      unset for [tag = 100:200] label tag

Nested iteration is supported:

      set for [i=1:9] for [j=1:9] label i*10+j sprintf("%d",i*10+j) at i,j

See additional documentation for iteration, ‘do‘.

This document was generated on February 28, 2014 using texi2html 5.0.

© 2000-2019
Individual documents may contain additional copyright information.