Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnuplot - data points and interpolation

Tags:

gnuplot

I have two columns in my data file:

  x  y
  1  5
  1  10
  2  3
  4  5
  4  6
  4  14

That is I have a set of results (y values) for particular value x. I want to produce a graph with gnuplot that shows all the data points shown above and a curve that goes through their average values:

  x  y
  1  (5+10)/2
  2  3
  4  (5+6+14)/4

This should be fairly simple but I can't find it.

How can I do that?

like image 995
Martin Vseticka Avatar asked Jul 25 '13 14:07

Martin Vseticka


1 Answers

plot "datafile" u 1:2 smooth unique

does exactly what you want.

like image 141
Christoph Avatar answered Sep 22 '22 02:09

Christoph