gnuplot错误(?)打印数据文件
我编写了以下“tmp.dat”数据文件 我的gnuplot脚本gnuplot错误(?)打印数据文件,gnuplot,Gnuplot,我编写了以下“tmp.dat”数据文件 我的gnuplot脚本 set datafile separator ";" set datafile missing "?" set grid set xlabel "coarsening level" set ylabel "rrmen3a1" set xrange [-1:7] set yrange [*:*] set terminal pdf color set output "tmp.pdf" plot \ "tmp.dat" usi
set datafile separator ";"
set datafile missing "?"
set grid
set xlabel "coarsening level"
set ylabel "rrmen3a1"
set xrange [-1:7]
set yrange [*:*]
set terminal pdf color
set output "tmp.pdf"
plot \
"tmp.dat" using 2:21 index 0 with lp title columnheader(1), \
# EOF
不绘制“第一”点(0,0.00172),仅绘制点x=1,…,6
有什么提示吗?问题在于打印线
plot "tmp.dat" using 2:21 index 0 with lp title columnheader(1)
这指示gnuplot使用第一条记录(不包括注释行)作为列标签。因此,您的第一行数据被解释为一个标题。如果不想重新格式化数据文件,可以使用将用作数据系列标签的相同头文件绘制虚拟曲线。差不多
plot "tmp.dat" using 2:21 index 0 with lp lt 1 lc rgb 'black' notitle, \
"tmp.dat" using ($0):(1/0) index 0 with lp lt 1 lc rgb 'black' columnhead(1)
请注意,我们必须手动指定线条样式,以确保关键点的线条样式与曲线的线条样式相同。第一行由
标题栏标题使用。
感谢Gavin的详尽解释!
plot "tmp.dat" using 2:21 index 0 with lp lt 1 lc rgb 'black' notitle, \
"tmp.dat" using ($0):(1/0) index 0 with lp lt 1 lc rgb 'black' columnhead(1)