Is there a way to plot a function based on values from a text file?
I know how to define a function in gnuplot and then plot it but that is not what I need. I have a table with constants for functions that are updated regularly. When this update happens I want to be able to run a script that draws a figure with this new curve. Since there are quite few figures to draw I want to automate the procedure.
Here is an example table with constants:
location a b c
1 1 3 4
2
There are two ways I see to solve the problem but I do not know if and how they can be implemented.
- I can then use awk to produce the string:
f(x)=1(x)**2+3(x)+4
, write it to a file and somehow make gnuplot read this new file and plot on a certainx
range. - or use awk inside gnuplot something like
f(x) = awk /1/ {print "f(x)="$2
etc., or use awk directly in the plot command.
I any case, I'm stuck and have not found a solution to this problem online, do you have any suggestions?