On Sat, Dec 16, 2023 at 7:11 PM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
Am 17.12.2023 um 01:01 schrieb Cottrell, Allin:
> On Sat, Dec 16, 2023 at 6:40 PM Sven Schreiber
> <sven.schreiber(a)fu-berlin.de> wrote:
>> <hansl>
>> open denmark
>> string s
>> gnuplot LRM --time-series --outbuf=s { set title 'My Title';} # works
>> gnuplot --inbuf=s --output=display { set title 'My Title';} # fails
>> </hansl>
>>
>> Two questions:
>>
>> - The first gnuplot invocation works, but it also produces a displayed
>> plot. Is this intended even though the outbuf option is given? I would
>> have thought that it only writes the output to the string s, not also
>> displaying something.
> On Linux the plot is not displayed in this case; I'll have to try on Windows.
Actually, this is not 100% reproducible, or doesn't happen at every
execution of the script (or with the last line commented out). Sometimes
the display seems to be a "leftover" from the previous (failed)
execution of the script. Quite strange behavior.
>> - The second gnuplot line yields a parser error. Is the inbuf option
>> incompatible with further added gnuplot commands?
> So it would seem. I'll look into it, but it seems reasonable that if
> you've already created a plot buffer there would be no need to mess
> with it further. In the example, "My Title" is shown via the second
> gnuplot command (if the "{ set ... }" addition is dropped) since it
> was specified when the buffer was created.
Yes, the double title assignment is of course not a real-world example.
The background is this ticket:
https://sourceforge.net/p/gretl/feature-requests/191/. The idea was to
divert output from "freq" via "--buffer=s" (working though
undocumented)
and then add the title later with the gnuplot command using --inbuf,
basically as a workaround for the limitation of freq.
OK, I see the use case. In git, the "{...}" literal mechanism is now
supported in the context of the --input and --inbuf options.
Allin