Gnuplot smooth confidence interval lines as opposed to error bars

非 Y 不嫁゛ 提交于 2019-12-18 23:04:26

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/25512006/gnuplot-smooth-confidence-interval-lines-as-opposed-to-error-bars

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!