I know how to use $
with using
in examples like
plot datafile using f($1):g($2)
to plot functions of column data. But I want to use this feature in a loop:
plot for [c=1:10] datafile using f($(c)):g($(c+1))
Of course this code doesn't work. I guess that if I know how to convert the integer c
to a string (or a single ASCII character) then it would work. How can I do it?
(If the same task can be done without conversion of integer to string, that would be fine too.)
You can Use intrinsic function sprintf to convert numbers to string
gnuplot> a=3; b=6;
gnuplot> plot a*x+b title sprintf("a=%1.2f; b=%1.2f",a,b)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With