新建一个文件stat.gnuplot
set terminal gif small
set output "output.gif"
set size 0.5,0.6
set style line 1 lt 1 lw 10 pt 9 ps 2
set style line 2 lt 9 lw 10 pt 9 ps 2
set style line 3 lt 3 lw 10 pt 9 ps 2
set key right bottom
set ylabel "count"
set xlabel "build"
plot \
"input.txt" us ($1) ti "fail" ls 1 with linespoints, \
"input.txt" us ($2) ti "block" ls 2 with linespoints, \
"input.txt" us ($3) ti "total" ls 3 with linespoints
再建立一个输入数据的文件input.txt
0 0 0
1 2 6
1 1 6
0 0 0
2 4 16
1 3 16
0 0 16
0 0 16
然后执行以下命令
$ gnuplot stat.gnuplot
就会生成一个output.gif图片

参数设置
set style line 1 lt 1 lw 10 pt 9 ps 2
设置一种线型,lt是颜色,lw是线宽,pt是点形状,ps是点大小
"input.txt" us ($3) ti "total" ls 3 with linespoints
"input.txt" 使用文件作为数据来源画一条线
us ($3) 使用第三列
ti "total" 该线标题设为total
ls 3 使用前面定义的第三种线型
with linespoints 绘制点线图
参考资料
GNUPLOT使用手冊
http://dsec.pku.edu.cn/dsectest/dsec_cn/gnuplot/