1
votes

I am working on gnuplot linepoints to create a comulative and normal distribution graph. I have created a file to provide the information to both graphs. I got a problem when I was trying to plot the last data. Here is the my script to create the second graph.

plot.plt

set term pos eps
set style data linespoints
set style line 1 lc 8 lt -1    

set size 1,1
set yr [0:20]
set key below 
set grid
set output 'output.eps'
plot "<awk '{i=i+$3; print $1,i}' data.dat" smooth cumulative t 'twitter' ls 1

data.dat

5.0     1   0.10
9.0     5   0.20
13.0    7   0.30
14.0    1   0.20
15.0    9   0.20

I want to create x axis with the first column and y axis with the last column. so the y axis range must between 0 to 1. which part should I change? thanks

1

1 Answers

2
votes

Using smooth cumulative is enough, no need for awk. You are doing the same operation twice, once with gnuplot and once with awk. Simply do

plot 'data.dat' using 1:3 smooth cumulative