Thanks, Sven. Of course I am aware of these two options -- but good to
have them here repeated on the mailing list.
I think the relevant part here is indeed: "Given that the doc says that
"literal" gnuplot commands are needed..."
Best,
Artur
Am Dienstag, dem 17.06.2025 um 08:39 +0200 schrieb Sven Schreiber:
>
> Am 16.06.2025 um 20:26 schrieb Artur T.:
>
> >
> > 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.
> >
>
> Given that the doc says that "literal" gnuplot commands are needed,
> I'd say it's not officially supported, although obviously it does
> work to some extent.
>
> One tested workaround would be to use string substitution:
>
> <hansl>
>
> set verbose off
> nulldata 10
> series y = normal()
> scalar a = 0.98
> string sta = sprintf("Some statistics = %.2f", a)
>
> gnuplot y --time-series --output=display {set title "@sta";}
>
> </hansl>
>
> Or a plot block with an embedded printf can be used:
>
> <hansl>
>
> set verbose off
> nulldata 10
> series y = normal()
> scalar a = 0.98
>
> plot y
> option time-series
> printf "set title 'Some statistics = %.2f';", a
> end plot --output=display
>
> </hansl>
>
> Note the inner single quotes here -- but alternatively escaped double
> quotes like \" can also be used.
>
_______________________________________________
Gretl-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Website:
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/