|
From: LukasP <LP...@po...> - 2010-08-07 20:24:35
|
Hello,
I have a datafile. I need to plot ratio of two columns, but selection of the
columns depends on variable KEY, which is passed to the plotting script.
Unfortunately, I'm not able to find any way how to create the plotting
command.
I need to get e.g.:
plot "IFs/ILs/Res/L31-" . WHAT . EXT . ".xF3" u 1:($3/$2) w lp t "CEN-L31"
but with "$3" and "$2" are varying (or are depending on the KEY variable).
I tried something like:
KEY=2
plot "IFs/ILs/Res/L31-" . WHAT . EXT . ".xF3" u 1:(sprintf("($%d/$%d)", KEY
+ 1, KEY)) w lp t "CEN-L31"
but I got "Warning: empty y range [7.3327e+268:7.3327e+268], adjusting to
[7.25937e+268:7.40602e+268]" and nonsensical plot.
If I tried:
KEY=2
plot "IFs/ILs/Res/L31-" . WHAT . EXT . ".xF3" u sprintf("1:($%d/$%d)", KEY +
1, KEY) w lp t "CEN-L31"
I got a plot, but values were not ratios of the two specified columns.
I tried:
RAT(i)=sprintf("1:($%d/$%d)", i + 1, i)
plot "IFs/ILs/Res/L31-" . WHAT . EXT . ".xF3" u eval(KEY) w lp t "CEN-L31"
but I got "_CompIFs.gp", line 84: undefined function: eval"
Is there a way how to get the ratio of the columns, depending on a variable
(KEY)? Maybe using macros, eval?
And another question -
- Is it possible to "continue" plotting?
I mean something like:
plot sin(x)
plot cos(x) # But don't clear the preceding plot!
when I want to get:
plot sin(x), cos(x)
This would help me plotting two columns of a datafile, that plotting ratios
of two its columns.
Thank you in advance.
LuP
--
View this message in context: http://old.nabble.com/Plotting-ratio-of-i--and-j-th-columns%2C-i-and-j-changing-tp29376762p29376762.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|