我使用gnuplot制作了png图像:
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
}
然后我用avconv制作电影:
avconv -r $1 -i M%05d.png -c:v libx264 final_simulation.mp4
但是,我的电影在圆圈中看起来有闪烁的效果,而不像普通电影看起来那样平滑。这有什么补救措施吗?
gnuplot可以生成GIF动画。好吧,仍有轻微的闪烁。我不确定,也许你可以在转换成所需格式时用外部转换器摆脱它。
例如,使用此代码:
### 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
你会得到这个: