On Mon, Jun 16, 2025 at 7:27 PM Artur T. <atecon(a)posteo.de> wrote:
Hi all,
I just stumbled over the following trying to add a title to a plot:
<hansl>
set verbose off
nulldata 10
series y = normal()
scalar a = 0.98
gnuplot y --time-series --output=display \
{set title sprintf("Some statistics = %.2f", a);}
<>
As you can see, I tried to apply the handy expression using the sprintf() function. It
does _not_ provike an error, but the value of `a` is printed as `nan`.
Is sprintf() actually supported? If not, I guess an error should be thrown.
Definitely not supported. The more flexible syntax of the "plot" block
was introduced to support use of printf along with other things. As
for flagging an error, well, gretl is just going to pass the literal
string to gnuplot, making no attempt to parse it. You'll get a plot
error if gnuplot rejects the string, otherwise something like what you
observed.
Allin