gnuplot和stdin数据,脚本和命令行之间的不同行为

gnuplot和stdin数据,脚本和命令行之间的不同行为,gnuplot,Gnuplot,鉴于这个非常相似的数据集: 0 0.2 1 0.1 2 0.3 3 0.25 4 0.15 e 0 0.15 1 0.25 2 0.3 3 0.1 4 0.2 如果使用-e开关调用gnuplot嵌入程序: cat h.dataset | gnuplot -p -e "plot '-' u 1:2 w l, '-' u 1:2 w l" 我看到了EXEPCED结果(两行不同颜色,表示它从stdin中提取了两个数据集) 另一方面,如果我将plot命令放入文件并执行: cat h.dataset

鉴于这个非常相似的数据集:

0 0.2
1 0.1
2 0.3
3 0.25
4 0.15
e
0 0.15
1 0.25
2 0.3
3 0.1
4 0.2
如果使用-e开关调用gnuplot嵌入程序:

cat h.dataset | gnuplot -p -e "plot '-' u 1:2 w l, '-' u 1:2 w l"
我看到了EXEPCED结果(两行不同颜色,表示它从stdin中提取了两个数据集)

另一方面,如果我将plot命令放入文件并执行:

cat h.dataset | gnuplot -p h.gpi
我得到这个错误:

"h.gpi", line 1: warning: Skipping data file with no valid points
"h.gpi", line 1: warning: Skipping data file with no valid points

plot '-' u 1:2 title 'a' w l, '-' u 1:2 title 'b' w l
                                                     ^
"h.gpi", line 1: x range is invalid
我的gnuplot版本是:
gnuplot 5.0 patchlevel 5


我也试过这个变体:
plot'你想实现什么?从“帮助”“特殊文件名”
:“'-'用于将数据和命令放在一起很有用的情况”。看起来您正试图将它们拆分到多个文件中?打开,这样您就可以找到关于gnuplot和stdin的不一致的答案;一些答案报告'