I have column-formatted data and I want to make a splot of the logarithm of the 5th column versus the first two columns. I have tried:
set pm3d map splot "thing.file" u 1:2:log($5)
But I get the error
undefined value
How can I get gnuplot to plot a function of one of the columns of data?
This works:
splot "thing.file" u 1:2:(log($5))
In general, if a term is defined by a function of a column in a data file rather than the column itself, there need to be parentheses around that term.
To extend the solution, you can use multiple columns if your function requires multiple inputs: example:
plot "file" using 1:(x=$2, y=$3, f(x,y))
also works.
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