NEED FILES: rw.f90 drandom.f90 rw.gpl average histogram only the first time give appropriate execute permissions: > chmod a+x average histogram > gfortran rw.f90 drandom.f90 -o rw > ./rw Usage: ./rw > ./rw 100 10000 gnuplot> set term wxt enha gnuplot> plot " plot "dataR" u 2 w l t "R^2" gnuplot> plot "dataR" u 3 w l t "x","dataR" u 4 w l t "y" gnuplot> plot "dataR" u 5 w l t "n" gnuplot> load "rw.gpl" gnuplot> unset arrow;set size nosquare;set xrange [*:*];set yrange [*:*] Now compute some numbers: > awk '{print $2}' dataR | ./average > rm dataRN > foreach n ( 10 50 100 500 1000 2000 4000 6000 8000 10000) foreach? ./rw 10000 $n foreach? awk '{print $2}' dataR | ./average | awk -v n=$n '{print n,$0}' >>dataRN foreach? echo $n foreach? end gnuplot> plot "dataRN" u 1:2:4 w e gnuplot> fit a*x+b "dataRN" u 1:2:4 via a,b gnuplot> plot "dataRN" u 1:2:4 w e,a*x+b