|
From: Dmitri A. S. <das...@gm...> - 2013-02-08 03:27:18
|
CC to the list
---------- Forwarded message ----------
From: Dmitri A. Sergatskov <das...@gm...>
Date: Thu, Feb 7, 2013 at 9:26 PM
Subject: Re: replot in "do for ..." loop
To: Hans-Bernhard Bröker <HBB...@t-...>
On Thu, Feb 7, 2013 at 9:22 PM, Hans-Bernhard Bröker
<HBB...@t-...>wrote:
> 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.
>
>
OK, but then why "w" gets expanded in
set multiplot layout 2,2 ; do for [w = 1:4] {plot sin(w*x)}; unset multiplot
?
Dmitri.
--
|