1

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 Answer 1

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

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for your awnser, when i put this command i take that error, Cannot open load file 'using' line 0: util.c: No such file or directory. and the plot is coming in the front again with dots. Also when i write the (time,server1,server2) i take plot 'data.dat' line 0: Bad data on line 1
How are you calling the command? It looks like the '' is being removed so gnuplot thinks the file is called using
i have a bash file. Starting 3 programms in the same time, so i use that command above
A couple of things you could try. Check the command runs from the command line and replace the '' with 'data.dat'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.