gnuplot:GIF 终端中具有 3D 圆圈的视角相关颜色

gnuplot: viewing angle dependent colors with 3D circles in GIF terminal

使用 gnuplot 5.4 (Win7),我尝试在 3D 中制作圆圈动画,基本上是 的动画版本。

测试数据 $Data 包含从 0x00000000xffffff 的随机 x,y,z 坐标、随机大小和随机颜色。创建动画 GIF 时,圆圈会根据视角改变颜色。

据我所知,GIF被限制为256色,显然不是0x00000000xffffff的所有颜色都能显示。 我希望 gnuplot 以某种方式采用最接近的颜色并坚持下去。 然而,我完全没有想到圆圈的颜色会随着角度的不同而变化。

这是为什么?如何解决这个问题?

代码:

### animated plot with circles in 3D (only for gnuplot >=5.4)
reset session

set term gif size 400,400 animate delay 30 optimize
set output "WithCircles3D.gif"

# create some test data
set print $Data
    do for [i=1:100] {
        print sprintf("%g %g %g %g %g", rand(0), rand(0), rand(0), rand(0)*0.02+0.02, int(rand(0)*0xffffff))
    }
set print

set view equal xyz
set xyplane at 0
set border 4095
set xtics 0.2
set ytics 0.2
set ztics 0.2
set style fill solid 1.0

do for [a=5:360:10] {
    set view 60,a,1.25
    splot $Data u 1:2:3:4:5 w circles lc rgb var notitle
}
set output
### end of code

结果:

结果2:(使用term pngcairo导出单个PNG帧并用其他软件将它们组合成动画GIF时随机设置不同。)

我认为work-around是不使用“优化”选项。它依赖于上游支持(在 libgd 中),这些支持多年来一直不可靠,如果没有彻底中断的话。也许我们应该弃用 gnuplot 选项或完全删除它。

如果您删除该关键字,您显示的示例将正常工作,对吗?