質問

I can't figure out if it is possible to do something like

f_L0(FL)=(stats FL using ($8) name "L", \
   L = L_mean, \
   1)

Gnuplot keeps complaining: ')' expected and points to FL inside the function.

Any ideas how to define some function like this?

p.s. my gnuplot is 4.6 (Feb2014).

UPDATE: since this is not possible, it seems, i would just do some analysis in Octave and output it to the file :)

役に立ちましたか?

解決

No, you cannot use stats inside of inline funcitons. Gnuplot functions are very basic and can contain only 'regular' mathematical function which compute a single numerical value. You cannot get access to data files inside of functions.

The stats command is command, which is the only command besides plot and splot which has access to data files.

The use of stats is as follows: You must use it as standalone command like

stats 'filename' using 8 name "L"

after which you have access to many variables which contain results from calculations on your data (column 8 in file filename). L_mean is one of those variables, for more see show variables after having executed stats.

However, you can do many calculations inside the using statement. To subtract the mean from you data, use e.g.:

stats 'filename' using 8 name "L"
plot 'filename' using ($8-L_mean)
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top