Raf*_*ael 4 animation gnuplot gif animated-gif antialiasing
例如,我需要在此代码中添加什么来激活抗锯齿?
set terminal gif animate delay 5 size 400, 250
set output "example.gif"
a = 0
do for [i=1:100] {
a = a + 0.1
plot sin(x + a)
}
Run Code Online (Sandbox Code Playgroud)
我需要更改 gnuplot 文件夹的某些文件吗?我正在使用 gnuplot 的 5.2 Windows 版本。
使用pngcairo具有抗锯齿功能的终端创建单独的 png 文件:
set terminal pngcairo size 400, 250
a = 0
do for [i=1:100] {
set output sprintf("%.3d.png",i)
plot sin(x + a)
a = a + 0.1
}
Run Code Online (Sandbox Code Playgroud)
然后你可以组装一个 gif 文件,例如,使用ImageMagick的convert:
convert -delay 5 -loop 0 *.png animation.gif
Run Code Online (Sandbox Code Playgroud)