You can, using the syntax very close to what you suggested. Define the following functions:
func1(x) = x / 2
func2(x) = x * 2
And use them as follows:
plot "input.dat" using (func1($1)):(func2($2))
This parenthesis node in the plot statement is necessary.
You can define functions of more than one variable:
func3(x, y) = x * y
They are used similarly:
plot "input.dat" using (func1($1)):(func3($1, $2))
source
share