gnuplot: plot two data sets from stdin

天涯浪子 提交于 2019-12-14 03:54:01

问题


I'm having some problems trying to plot two different data sets from stdin in gnuplot... This is the command I'm testing with:

% gnuplot -persist <<EOF            
plot '-' index 0 with points, \
'' index 1 with points
1 1.2
2 1.8
3 1.6


1.1 0.8
2.1 0.3
3.1 1.0
EOF

Any advise will be very helpful. Thanks


回答1:


I think this should help you

It’s even possible to read data from standard input multiple times within the same plot command:

plot '-', '-' 

will read data until an end-of-file character is encoun tered and then expect to read more data (for the second “file”) until finding a second EOF character. Of course, the data entered at a prompt this way can have multiple col umns, from which we can select some with using, and all the other features of the plot command can be used as well.

(from: Philipp K. Janert, Gnuplot In Action)




回答2:


Gnuplot probably wants to reread the input for the second index keyword, but stdin is not seekable. Create a temporary input file.



来源:https://stackoverflow.com/questions/8468099/gnuplot-plot-two-data-sets-from-stdin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!