I wonder if there is some workaround in Gnuplot to exchange something like
plot input.dat using ($1/2):($2*2) axis x1y1 w lp
with
plot input.dat using func1($1,$2):func2($1,$2) axis x1y1 w lp
with
func1(x,y) = x/2; func2(x,y) = y*2;
?
I would like to post-process my input data (line) before plotting.
You can, using syntax very close to what you’ve suggested. Define the functions like this:
And use them like this:
That knot of parentheses in the plot statement is necessary.
You can define functions of more than one variable:
These are used similarly: