With data file Data.csv :
0 0.00000 1 1.00000 2 1.41421 3 1.73205 4 2.00000 5 2.23607
You can perform linear editing with:
f(x) = a*x + b fit f(x) 'Data.csv' u 1:2 via a, b
You can use what I call a macro in gnuplot to set the title in the legend about your identified f(x) function with
title_f(a,b) = sprintf('f(x) = %.2fx + %.2f', a, b)
Now, to build the data with the regression function f(x) , simply do:
plot "Data.csv" u 1:2 wl, f(x) t title_f(a,b)
You must finish this plot:

Woltan
source share