#!/usr/bin/gnuplot set xlabel "Date" set ylabel "Count" set autoscale p(x) = m1*x + b1 m1 = -1e-5 b1 = 30000 fit p(x) 'test.dat' using 1:2 via m1, b1 plot 'test.dat' using 1:2, p(x)