Command and Script to re-read a file in gnuplot

风流意气都作罢 提交于 2020-01-14 04:39:32

问题


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

After that i have a script file, loop.plt, that is used to reread the file:

pause 2
replot
reread

And finally, the command I use in in a bash file:

gnuplot -persist -e "plot 'data.dat'" loop.plt

The result comes back as dots - not a line that I expected. But this is only for server1.

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?


回答1:


Change your command to the following:

gnuplot -persist -e "plot 'data.dat' using 1:2 with lines ,'' using 1:3 with lines" loop.plt

This plots columns 1 and 2 and columns 1 and 3 using lines



来源:https://stackoverflow.com/questions/17616780/command-and-script-to-re-read-a-file-in-gnuplot

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