|
From: Hans-Bernhard B. <br...@ph...> - 2004-09-09 10:36:02
|
On Thu, 9 Sep 2004, Ole Jacob Hagen wrote:
> I have datafile, with 3 columns, where column 1 indicates samplenumber,
> while col. 2 and col. 3 is values.
> I want to make a diff-plot, but how can I accomplish this?
By using tools outside gnuplot. gnuplot isn't really a number crunching
utility, and trying to use it as one is bound to fail sooner or later.
A little awk script does this quite nicely. Here's one from my
collection:
#! /bin/awk -f
BEGIN { firstline = 1 }
$0 !~ /^#/ { if (firstline == 1) {
old_x = $1
old_y = $2
firstline = 0
} else {
print (old_x + $1)/2.0, "\t", (old_y - $2)/(old_x - $1), "\t"
old_x = $1
old_y = $2
}
}
--
Hans-Bernhard Broeker (br...@ph...)
Even if all the snow were burnt, ashes would remain.
|