Gnuplot image to movie: Twinkling effect

288 Views Asked by At

I made png images using gnuplot:

do for [i=1:imax]{
   imagefile='M'.sprintf("%5.5i",i).'.png'
   datafile='A'.sprintf("%5.5i",j).'.dat'
   plot datafile u 2:3:(rad*$6) with circles lc rgb "black" lw 3
   pause 0
}

Then I used avconv to create movies:

avconv -r $1 -i M%05d.png -c:v libx264 final_simulation.mp4

However, my movies appear to have a twinkling effect in the circles and not smooth as a normal movie might look like. Is there any remedy for this?

2

There are 2 best solutions below

4
theozh On

gnuplot can generate animated gifs. Well, there is still a slight flickering. I'm not sure, maybe you can get rid of it with external converters when converting to the desired format.

For example, with this code:

### animation 
reset session

set term gif size 500,400 animate delay 10 optimize 
set output "AnimatedCircle.gif"

set yrange[-1.5:1.5]
set xrange[0:1]

imax = 100.
do for [i=0:imax] {
    plot '+' u (i/imax):(sin(2*pi*i/imax)):(0.1) \
    with circles lc rgb "black" lw 3 title sprintf("Circle %d",i)
}
set output
### end of code

you'll get this:

enter image description here

0
sagnik singha On