GNUplot 不打印线条

GNUplot doesn't print lines

我正在使用此脚本在 Gnuplot 中绘制一些数据。不幸的是,我的情节不打印线条,只打印点。

我做错了什么?

#!/usr/bin/gnuplot
reset
set terminal png
set output 'picture.png'
set xlabel "n"

set ylabel "time (s)"
set yrange [0:2]

set title "title"
set key reverse Left outside
set grid
set style data linespoints

plot "bla.txt" using 1:2 title "bla" with linespoints ls 1

很可能,您的数据文件在连续的数据条目之间包含空行。

一个数据文件

1 2

2 4

5 6

使用

绘制时仅显示三个点
plot 'data.txt' using 1:2 with linespoints

而数据文件

1 2
3 4
5 6

还显示了连接线。

这就是 gnuplot 处理其数据文件的方式。