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