Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #4494 > unrolled thread

animation from data files

Started byShahid Maqbool <shahid718@gmail.com>
First post2022-11-01 22:45 -0700
Last post2022-11-08 07:01 +0100
Articles 6 — 5 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  animation from data files Shahid Maqbool <shahid718@gmail.com> - 2022-11-01 22:45 -0700
    Re: animation from data files Olaf Schultz <o.schultz@enhydralutris.de> - 2022-11-02 16:29 +0100
    Re: animation from data files Karl Ratzsch <mail.kfr@gmx.net> - 2022-11-05 20:09 +0100
      Re: animation from data files Russell Kajouri <rasoulkajouri@gmail.com> - 2022-11-07 01:53 -0800
        Re: animation from data files Shahid Maqbool <shahid718@gmail.com> - 2022-11-07 18:58 -0800
          Re: animation from data files Jörg Buchholz <bookwood4new@freenet.de> - 2022-11-08 07:01 +0100

#4494 — animation from data files

FromShahid Maqbool <shahid718@gmail.com>
Date2022-11-01 22:45 -0700
Subjectanimation from data files
Message-ID<db4a49ca-2e44-4f78-8619-3d165b29404fn@googlegroups.com>
Dear all,

I have data files in the order like:

data_100.dat
data_200.dat
data_300.dat
...
data_10000.dat

here 100, 200, 300, ..., 10000 are the time steps.

I can successfully plot surface plot for data file  e.g., 'data_10.dat' with the command i.e., 

splot 'data_100.dat' matrix with pm3d notitle

Now, i want to make animation for my data files to see the
continuous evolution of the system.

I have gone throught the book 'Gnuplot in Action' and section 11.5 shows some animations, but it is not telling about loading different files. Also the online demos like 

https://gnuplot.sourceforge.net/demo/animate2.html

are not very helpful in this case.

So my question is, which commands or keywords should i use to load the continuous files and display the animation on the console?

Thanks a lot.

Best regards,
Shahid

[toc] | [next] | [standalone]


#4495

FromOlaf Schultz <o.schultz@enhydralutris.de>
Date2022-11-02 16:29 +0100
Message-ID<jsfgm9Fs5aoU1@mid.individual.net>
In reply to#4494
Am 02.11.22 um 06:45 schrieb Shahid Maqbool:
> Dear all,
> 
> I have data files in the order like:
> 
> data_100.dat
> data_200.dat
> data_300.dat
> ...
> data_10000.dat
> 
> here 100, 200, 300, ..., 10000 are the time steps.
> 
> I can successfully plot surface plot for data file  e.g., 'data_10.dat' with the command i.e.,
> 
> splot 'data_100.dat' matrix with pm3d notitle
> 
> Now, i want to make animation for my data files to see the
> continuous evolution of the system.
> 
> I have gone throught the book 'Gnuplot in Action' and section 11.5 shows some animations, but it is not telling about loading different files. Also the online demos like
> 
> https://gnuplot.sourceforge.net/demo/animate2.html
> 
> are not very helpful in this case.
> 
> So my question is, which commands or keywords should i use to load the continuous files and display the animation on the console?
> 
> Thanks a lot.
> 
> Best regards,
> Shahid


Here something like that (for a temperature-profile in the soil):

set grid
set terminal gif animate delay 0.1
stats "reform4anim.csv" nooutput
set output "animated.gif"
set xrange [0:15]
set yrange [-200:10]
do for [i=1:int(STATS_blocks):4] {plot "reform4anim.csv" u 2:1 index 
(i-1) with linespoints t "\@time","" u 2:1:3 index (i-1) w labels t 
"","Bodensonde_Statistik_h.csv" u 3:1 t "max" lc "red","" u 5:1 t "min" 
lc "blue","" u 4:1 t "avg" lc "black"}


HTH, Olaf

[toc] | [prev] | [next] | [standalone]


#4496

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2022-11-05 20:09 +0100
Message-ID<tk6cdf$er8v$1@solani.org>
In reply to#4494
Something like this?

    fname(n) = sprintf('data_%.f.dat',n)

    n=100
    while (n<=10000) {
       plot fname(n)
       n=n+100
    }




Am 02.11.2022 um 06:45 schrieb Shahid Maqbool:
> Dear all,
> 
> I have data files in the order like:
> 
> data_100.dat
> data_200.dat
> data_300.dat
> ...
> data_10000.dat
> 
> here 100, 200, 300, ..., 10000 are the time steps.
> 
> I can successfully plot surface plot for data file  e.g., 'data_10.dat' with the command i.e.,
> 
> splot 'data_100.dat' matrix with pm3d notitle
> 
> Now, i want to make animation for my data files to see the
> continuous evolution of the system.
> 
> I have gone throught the book 'Gnuplot in Action' and section 11.5 shows some animations, but it is not telling about loading different files. Also the online demos like
> 
> https://gnuplot.sourceforge.net/demo/animate2.html
> 
> are not very helpful in this case.
> 
> So my question is, which commands or keywords should i use to load the continuous files and display the animation on the console?
> 
> Thanks a lot.
> 
> Best regards,
> Shahid

[toc] | [prev] | [next] | [standalone]


#4497

FromRussell Kajouri <rasoulkajouri@gmail.com>
Date2022-11-07 01:53 -0800
Message-ID<f84cec9e-e72a-4a64-aabe-9c789b33cea3n@googlegroups.com>
In reply to#4496
Hi

I think that there is no need to use %f, and you can put the name of the file and its definition into the loop, and then it works better!


 n=100 
 while (n<=10000) { 
fname =  sprintf('data_%d.dat',n) 
plot fname 
 n=n+100
 } 




On Saturday, November 5, 2022 at 8:09:37 PM UTC+1, Karl Ratzsch wrote:
> Something like this? 
> 
> fname(n) = sprintf('data_%.f.dat',n) 
> 
> n=100 
> while (n<=10000) { 
> plot fname(n) 
> n=n+100
> } 
> 
> 
> 
> 
> Am 02.11.2022 um 06:45 schrieb Shahid Maqbool: 
> > Dear all, 
> > 
> > I have data files in the order like: 
> > 
> > data_100.dat 
> > data_200.dat 
> > data_300.dat 
> > ... 
> > data_10000.dat 
> > 
> > here 100, 200, 300, ..., 10000 are the time steps. 
> > 
> > I can successfully plot surface plot for data file e.g., 'data_10.dat' with the command i.e., 
> > 
> > splot 'data_100.dat' matrix with pm3d notitle 
> > 
> > Now, i want to make animation for my data files to see the 
> > continuous evolution of the system. 
> > 
> > I have gone throught the book 'Gnuplot in Action' and section 11.5 shows some animations, but it is not telling about loading different files. Also the online demos like 
> > 
> > https://gnuplot.sourceforge.net/demo/animate2.html 
> > 
> > are not very helpful in this case. 
> > 
> > So my question is, which commands or keywords should i use to load the continuous files and display the animation on the console? 
> > 
> > Thanks a lot. 
> > 
> > Best regards, 
> > Shahid

[toc] | [prev] | [next] | [standalone]


#4498

FromShahid Maqbool <shahid718@gmail.com>
Date2022-11-07 18:58 -0800
Message-ID<07acf207-092d-4419-82f2-f565a2f3d5e8n@googlegroups.com>
In reply to#4497
On Monday, 7 November 2022 at 6:53:13 pm UTC+9, rasoul...@gmail.com wrote:
> Hi 
> 
> I think that there is no need to use %f, and you can put the name of the file and its definition into the loop, and then it works better! 
> 
> 
> n=100 
> while (n<=10000) { 
> fname = sprintf('data_%d.dat',n) 
> plot fname 
> n=n+100
> } 
> 
> 
> 
> 
> On Saturday, November 5, 2022 at 8:09:37 PM UTC+1, Karl Ratzsch wrote: 
> > Something like this? 
> > 
> > fname(n) = sprintf('data_%.f.dat',n) 
> > 
> > n=100 
> > while (n<=10000) { 
> > plot fname(n) 
> > n=n+100 
> > } 
> > 
> > 
> > 
> > 

Hi all,

Following your suggestions i wrote it like that:

set grid
set terminal gif animate delay 0.1
fname(n) = sprintf('data_%d.dat',n)
n=100
while (n<=10000){
splot fname(n) matrix with pm3d notitle  
n=n+100
}

or 

set grid
set terminal gif animate delay 0.1

n=100
while (n<=10000){
fname = sprintf('data_%d.dat',n)
splot fname matrix with pm3d notitle  
n=n+100
}


but i always get this error:

more> ;splot fname(n) matrix with pm3d notitle  ;n=n+100;
                                                                                     ^
      cannot output binary data to wgnuplot text window

gnuplot> 

[toc] | [prev] | [next] | [standalone]


#4499

FromJörg Buchholz <bookwood4new@freenet.de>
Date2022-11-08 07:01 +0100
Message-ID<tkcrbk$3rljd$1@dont-email.me>
In reply to#4498
On 08.11.2022 03:58, Shahid Maqbool wrote:
> On Monday, 7 November 2022 at 6:53:13 pm UTC+9, rasoul...@gmail.com
> wrote:
>> Hi
>> 
>> I think that there is no need to use %f, and you can put the name
>> of the file and its definition into the loop, and then it works
>> better!
>> 
>> 
>> n=100 while (n<=10000) { fname = sprintf('data_%d.dat',n) plot
>> fname n=n+100 }
>> 
>> 
>> 
>> 
>> On Saturday, November 5, 2022 at 8:09:37 PM UTC+1, Karl Ratzsch
>> wrote:
>>> Something like this?
>>> 
>>> fname(n) = sprintf('data_%.f.dat',n)
>>> 
>>> n=100 while (n<=10000) { plot fname(n) n=n+100 }
>>> 
>>> 
>>> 
>>> 
> 
> Hi all,
> 
> Following your suggestions i wrote it like that:
> 
> set grid set terminal gif animate delay 0.1 fname(n) =
> sprintf('data_%d.dat',n) n=100 while (n<=10000){ splot fname(n)
> matrix with pm3d notitle n=n+100 }
> 
> or
> 
> set grid set terminal gif animate delay 0.1


You must specify a output file name.
set out 'filename.gif'


> n=100 while (n<=10000){ fname = sprintf('data_%d.dat',n) splot fname
> matrix with pm3d notitle n=n+100 }
> 
> 
> but i always get this error:
> 
> more> ;splot fname(n) matrix with pm3d notitle  ;n=n+100; ^ cannot
> output binary data to wgnuplot text window
> 
> gnuplot>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web