Gentoo Archives: gentoo-user

From: Hareesh Nagarajan <hareesh.nagarajan@×××××.com>
To: gentoo-user@l.g.o
Cc: wwong@×××××××××.edu
Subject: Re: [gentoo-user] Can I do this with GNUPLOT?
Date: Fri, 23 Sep 2005 04:34:10
Message-Id: 7728232c050922212916ae3d96@mail.gmail.com
In Reply to: Re: [gentoo-user] Can I do this with GNUPLOT? by Willie Wong
1 On 9/22/05, Willie Wong <wwong@×××××××××.edu> wrote:
2 > the problem needs to be specific because I have no idea what you are
3 > thinking of:
4
5 So I have the following files: rate1.txt, rate2.txt, ..., rateN.txt
6 rate1.txt has the following contents:
7
8 0 5
9 1 10
10 2 11
11 3 12.5
12 ...
13 ...
14
15 rate2.txt has the following contents:
16
17 0 15.7
18 1 12
19 2 12
20 3 124.5
21 ...
22 ...
23
24 and so on.
25
26 Now, I want to plot a graph which will take the corresponding lines
27 from each of the files and average it out:
28
29 For example: If I had rate1.txt and rate2.txt, I basically wish to
30 plot a file which looks like this
31
32 0 (5+15.7)/2
33 1 (10+12)/2
34 ...
35 ...
36
37 What I could do (and what I have done) is create a file rate.txt which
38 averages out the values in rate1.txt, rate2.txt,... rateN.txt and then
39 I could just plot rate.txt simply using GNUPLOT.
40
41 So I was wondering if I could avoid that step and tell GNUPLOT to do
42 the following:
43
44 ``Hey GNUPLOT open files rate1.txt and rate2.txt. Let column1 in
45 rate1.txt be $1, column2 in rate1.txt be $a and column2 in rate2.txt
46 be $b, so plot $1 on the X axis and ($a+$b)/2 on the Y axis."
47
48 Whew!
49
50 Thanks for reading this!
51
52 Hareesh
53
54 --
55 gentoo-user@g.o mailing list