2

I have data collected in one two column file, and I want to animate this data. The data file has the points in sets of 100 points, one after the other something like this:

...
98 0.34
99 .036
100 .40
1 .01
2 .05
...

and I am looking to a gnuplot algorithm that would look like this:

reset
set term gif animate
set output "animate.gif"

do for [i=0:49]{
   plot "<(sed -n 'i*100+1,(i+1)*100p' data.dat)" using 1:2 with lines
}
set output
set term x11

How can I make the i change inside "plot ... lines"?

This question is inspired by this other one

Community
  • 1
  • 1
iiqof
  • 157
  • 10

1 Answers1

1

Ok, I think i got it, because I'm getting what I want, I changed the line

plot "... lines

by

plot "data.dat" every ::i*100+1::(i+1)*100 using 1:2 and it seems to work well. The answer was also in the same link https://stackoverflow.com/questions/9536582

Community
  • 1
  • 1
iiqof
  • 157
  • 10