Smyth, Steve wrote:
> Is it possible to read in formula constants form a datafile. I have
> numerous functions that I would like to plot on the same figure. All
> of the functions have the same form, but slightly different
> constants. For simplicity, say the function is f(x)=a*x. Can "a" be
> read in from a datafile and then f(x) plotted?
Reading one 'a' from a file, then making a plot if it, is trivial: just
make the file read
a = 1
then
load 'file'
plot f(x)
For more complex cases, e.g. involving a single plot, multiple different
values of 'a', but only one defined function f, this won't work --- it
would require the 'plot' command to run two nested loops, one over the
table of values for 'a', the other over 'x'. gnuplot doesn't do that.
|