Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gnuplot smooth confidence interval lines as opposed to error bars

I'd like a 95% confidence interval line above and below my data line - as opposed to vertical bars at each point.

Is there a way that I can do this in gnuplot without plotting another line? Or do I need to plot another line and then label it appropriately?

like image 345
Charon Avatar asked Aug 26 '14 17:08

Charon


1 Answers

You can use the filledcurves style to fill the region of 95% confidence. Consider the example data file data.dat with the content:

# x y   ylow yhigh
1   3   2.6  3.5
2   5   4    6
3   4   3.2  4.3
4   3.5 3.3  3.7

and plot this with the script

set style fill transparent solid 0.2 noborder
plot 'data.dat' using 1:3:4 with filledcurves title '95% confidence', \
     '' using 1:2 with lp lt 1 pt 7 ps 1.5 lw 3 title 'mean value'

to get

enter image description here

like image 135
Christoph Avatar answered Sep 19 '22 06:09

Christoph