I have some data.
#Time Distance
1 3
2 5
4 9
8 11
12 17
14 20
16 34
20 40
I want to plot the cumulative distance wrt time in gnuplot ... (it should be easy) but I do not know how.
x
I have some data.
#Time Distance
1 3
2 5
4 9
8 11
12 17
14 20
16 34
20 40
I want to plot the cumulative distance wrt time in gnuplot ... (it should be easy) but I do not know how.
x
I have a little experience with Gnuplot and I just pored over the documentation some. Unfortunately, I wasn't able to find a solution for generating a cumulative sum as you're plotting.
I think what you'll need to do is to massage your data with another program before letting Gnuplot at it. awk is one program that comes to mind, it's practically built for fiddling with columnar data. You can integrate this process into the plotting process by following these instructions.
Assuming your data is in a file "test.txt", how about:
plot "<awk '{i=i+$2; print $1,i}' test.txt" with lines