A Simple GNUPLOT Fit Example

# file test.dat
#
# format: 
# x value y value y error
1 2 1 
3 4 1 
5 6 1
7 8 1
8 6 1
9 4 1
10 2 1


#
# set title "Test Example"
# set xlabel "Dependent Variable [sec]"
# set ylabel "Independent Variable [cm]"
#
# >>> Fit to a quadratic function
# f(x) = a*x**2 + b*x + c
# fit f(x) "test.dat" using 1:2:3 via a, b, c
# plot [0:11] f(x), "test.dat" with errorbars pointsize 2
#
# >>> Fit to a Gaussian function plus a constant
# g(x) = c/(a*sqrt(2*3.14))*exp(-(x-b)**2/(2*a**2)) + d   
# fit g(x) "test.dat" using 1:2:3 via a, b, c, d  
# plot [0:12] g(x), "test.dat" with errorbars pointsize 2
#
#
# gnuplot fit output written to fit.log
#
# printing out
# set terminal postscript
# set output "gtest.ps"
# plot [0:11] f(x), "test.dat" using errorbars pointsize 2
#