带有错误栏绘制的gnuplot [英] gnuplot with errorbars plotting
问题描述
"file.txt"文件中的数据如下所示(显示示例行)
The data in my "file.txt" file are as in the following (sample row shown)
31 1772911000 6789494.2537881
请注意,第二列是平均值,第三列是 输入样本.因此,对于误差线,我需要在x轴值31处的误差线,误差线的起点是(第二列值)-(第三列值),结束于(第二列值)+(第三列值) ).我尝试了以下方法:
Note that the second column is the mean and the third is the standard deviation of my input sample. So, for the error bar, I would need the bar at the x axis value 31, with the error bar start at (second column value)-(third column value), and end at (second column value)+(third column value). I tried the following:
plot "file.txt" using ($1-$2):1:($2+$1) with errorbars
但是结果不合适.有帮助吗?
but the result is inappropriate. Any help?
推荐答案
您需要x:y:err,所以请尝试
You need x:y:err, so try
plot "file.txt" using 1:2:3 with yerrorbars
您可能想要烛台.这些通常是一个带有误差线的框,误差线从顶部和底部延伸出来,但是将最小值和最大值设置为相同,应该会为您提供所需大小的框:
You may instead want candlesticks. These are generally a box with error bars extending out of the top and bottom, but setting the mins and maxes the same should give you boxes of the required size:
plot "file.txt" using 1:($2-$3):($2-$3):($2+$3):($2+$3) with candlesticks
这篇关于带有错误栏绘制的gnuplot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!