From: HansBernhard Bröker <HBB<roeker@t...>  20130208 03:25:54

[Forgot to CC list...] On 08.02.2013 04:08, Dmitri A. Sergatskov wrote: > So I would expect the result to be the same as in > > gnuplot> plot sin(x) > gnuplot> replot sin(2*x) > gnuplot> replot sin(3*x) > gnuplot> replot sin(4*x) > That expectation fails because you assume 'w' to be expanded during command construction. It's not What you actually created was plot sin(x) replot sin(w*x) replot sin(w*x) replot sin(w*x) which is, not coincidentally, also indicated by the legend entries: the 2nd to 4th entry all say "sin(w*x)", because that's what you're plotting. To get what you actually wanted, you should put that loop _into_ the plot command: plot sin(x), for [w = 2:4] sin(w*x) 