Skip to content

Instantly share code, notes, and snippets.

@ralfebert
Created April 4, 2013 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralfebert/5312018 to your computer and use it in GitHub Desktop.
Save ralfebert/5312018 to your computer and use it in GitHub Desktop.
Plotting and fitting values to a linear equation from CSV data with gnuplot
set datafile separator ';'
set terminal png
set output 'values.png'
f(x) = a*x + b
fit f(x) 'values.csv' using 1:2 via a, b
plot 'values.csv' using 1:2, f(x) title sprintf('%.2fx + %.2f', a, b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment