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?
plot "datafile" u 1:2 smooth unique
does exactly what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With