Top: Table of contents
Up: Table of contents chapter 8
Next: 8.4 User-defined variable
Previous: 8.2 2D data plot

8.3 Error bar

GNUPLOT 提供繪製 error bar 的方式有兩種:一種是設定 y delta,即標出 一段誤差的範圍。另一種是設定 y low 與 y high,分別設定上下兩邊的誤差量。 一般繪製 error bar 是採用後者,故每一點需用四筆數字來描述。如第二個例子, 採用 plot "err.dat" using 1:2:5 with errorbars 時,只採用第一、第二及 第五行的數據。此時使用 y delta 方式描繪 error bar。

set xrange [-3:65]
set yrange [ 4:14]
set title "Plot data file twice to get lines and errorbars"
plot "err.dat" with lines, "err.dat" using 1:2:3:4 with errorbars

# data file: err.dat
0       11.062  9.757   12.667  2.345
2       9.212   8.0908  10.932  1.725
5       8.55    7.6612  9.0388  2.846
                   .
                   .
                   .
60      8.286   7.7265  8.755   1.0
set xrange [-3:65]
set yrange [ 4:14]
set title "Demonstration of error bars (only ydelta)"
plot "err.dat" using 1:2:5 with errorbars

# data file: err.dat
0       11.062  9.757   12.667  2.345
2       9.212   8.0908  10.932  1.725
5       8.55    7.6612  9.0388  2.846
                   .
                   .
                   .
60      8.286   7.7265  8.755   1.0
set xrange [-3:65]
set yrange [ 4:14]
set title "error bars (both ylow and yhigh, default format)"
plot "err.dat" with errorbars

# data file: err.dat
0       11.062  9.757   12.667  2.345
2       9.212   8.0908  10.932  1.725
5       8.55    7.6612  9.0388  2.846
                   .
                   .
                   .
60      8.286   7.7265  8.755   1.0

圖 19: Example : error bar


Top: Table of contents
Next: 8.4 User-defined variable