Thanks for the really fast answers.
I didn't know that one too. But this doesn't solve the whole problem.
The text file is the output of a program, and so there are new entries all the time. I would like to watch them in gnuplot.
Now i am using gnuplot4. Here it is possible to refresh the data with the keys "A" or "E". That ok but it either has a fixed view, or it resizes the whole view to see the whole graph.
I need too see the last entries only. Like "moving" the graph "to the right" without changing the "zoom".
Michael
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]
I do this with a combination of expect and gnuplot. You need to write an expect script that will:
1. Startup gnuplot
2. tail -50 data >data.50
3. send gnuplot: plot 'data.50'
4. tail -50 data >data.50
5. send gnuplot: replot
6. sleep
7. goto 4.
Examples:
data.expect:
#!/usr/bin/expect
system tail -50 data >data.50
spawn gnuplot data.gnuplot -
while {1} {
sleep 1
system tail -50 data >data.50
expect ">"
send "replot\r" #replot will keep the geometry but adjust the plot axis to match data unless you use set range commands.
}
data.gnuplot:
plot "data.50" with linespoints
For more advanced functions like interaction (A and E keys) use the expect "interact" statements. Get the book "Exploring Expect". You can get expect/tcl here (you need tcl for expect):
[a href=\"http://sense.net/zc/files/]http://sense.net/zc/files/[/url]
An an X/QT version of gnuplot 4 I built here:
http://sense.net/zc/gnuplot/