使用Gnuplot中的公式添加误差线

时间:2016-02-19 11:52:50

标签: plot error-handling gnuplot gnu static-analysis

我有换能器数据,我知道我有一个突然的准确性: This is the error within the different transducers in the y-axes

我的问题是:如何将y-errorbars添加到现有代码中?

set xlabel "Time [min]" 
set ylabel "Temperature [Celsius]"
plot '150830AW.dat'  every ::1188::1231 using 4:52 w l lc rgb 'green' title "Run 1", \
    '150830AW.dat'  every ::1251::1284 using 4:52 w l lc rgb 'blue' title "Run 2", \
                        90 title "Standard" with lines linestyle 2

set xlabel "Time [min]"
set ylabel "Pressure [MPa]"
plot '2015 08 30 0000 Pelletizer Feed (Wide).dat'  every ::2372::2459 using 4:($8*0.006894759086775369) w l lc rgb 'green' title "Run 1", \
    '2015 08 30 0000 Pelletizer Feed (Wide).dat'  every ::2498::2565 using 4:($8*0.006894759086775369) w l lc rgb 'blue' title "Run 2"

1 个答案:

答案 0 :(得分:1)

看一下这些演示:errorbars。基本上你需要第三列错误。

由于压力准确度为0.5%,因此您必须将压力列乘以0.005,以使using 4:52成为using 4:52:($52*0.005)

要激活错误栏,您需要将w l(即带有行)替换为with errorbars

如果你想要行错误栏,你必须保留你的行并添加这一新行,例如:

plot '150830AW.dat'  every ::1188::1231 using 4:52 w l lc rgb 'green' title "Run 1", \
     ''  every ::1188::1231 using 4:52:($52*0.005) w errorbar lc rgb 'green' notitle, \
     '150830AW.dat'  every ::1251::1284 using 4:52 w l lc rgb 'blue' title "Run 2", \
     ''  every ::1251::1284 using 4:52:($52*0.005) w errorbar lc rgb 'blue' notitle, \
     90 title "Standard" with lines linestyle 2

如果你想要更好的东西,请查看fill between curves