I do not quite understand why the samples are not the solution to your problem.
If I want to plot sin (x) between 0 and 10 with a dot in each integer, I use
set xrange [0:10] set sample 11 plot sin(x) wp
Obviously, the number of samples is xmax-xmin + 1 (10 - 0 + 1 = 11).
Finally, to solve the approximation problem, check out this website for a discussion on linear least squares binding. For simple linear interpolation, use lp instead of p .
source share