命令和脚本重新读取gnuplot中的文件 [英] Command and Script to re-read a file in gnuplot
问题描述
我是新到gnuplot和使用Ubuntu 12.04。我想在信息进来的时候创建一个图表。所以我有一个data.dat文件,看起来像:
I am new to gnuplot and using Ubuntu 12.04. I want to create a graph on the fly when the information is coming in. So i have a data.dat file which looks like:
time server1 server2
0 0 0
1 2000 3000
2 3000 4000
3 4000 5000
之后,我有一个脚本文件loop.plt,用于重新读取文件:
After that i have a script file, loop.plt, that is used to reread the file:
pause 2
replot
reread
我在bash文件中使用的命令:
And finally, the command I use in in a bash file:
gnuplot -persist -e "plot 'data.dat'" loop.plt
结果以点 - 而不是我预期的行返回。但这只适用于server1。
The result comes back as dots - not a line that I expected. But this is only for server1.
我如何改变这一点来创建一个带有图形的图形,并且在同一个图形中显示server2?
How can I change this to create the graph with a line, and also to show the server2 in the same graph? Can someone help me with this?
推荐答案
将您的命令更改为以下内容:
Change your command to the following:
gnuplot -persist -e "plot 'data.dat' using 1:2 with lines ,'' using 1:3 with lines" loop.plt
这使用线绘制列1和2以及列1和3。
This plots columns 1 and 2 and columns 1 and 3 using lines
这篇关于命令和脚本重新读取gnuplot中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!