在 3D 绘图的 gnuplot 中叠加向量、dgrid3d 和 pm3d

Superimposing vectors, dgrid3d and pm3d in gnuplot for 3D plot

我正在尝试在 Gnuplot 中绘制叠加 dgrid3d、pm3d 和矢量的矢量场。 我可以让 dgrid3d 和 pm3d 工作,但是当我尝试叠加向量时,奇怪的事情发生了。

我正在尝试以下操作:

set dgrid3d 50,50,2
set pm3d at b
set hidden3d
splot 'v-field.dat' u 1:2:6 w l, "" u 1:2:3:4:5:6 w vectors

数据格式为:

0.0000000020000000 0.0833272880000000 0 0 0 1.62609277247135e-09
0.5000000020000001 0.5833272880000000 0 0 0 0.965930741599645
0.8749688835000000 0.2083182225000000 0 0 0 0.233003475483508
0.3749688835000000 0.7083182225000000 0 0 0 0.732959928249388
0.7499740065000000 0.3333133385000000 0 0 0 0.612400228894737
0.2499740065000000 0.8333133384999999 0 0 0 0.353562980611359
0.6250021815000000 0.4583253445000000 0 0 0 0.915969987957243
0.1250021814999999 0.9583253445000000 0 0 0 0.0499605601370936
0.2500301575000000 0.0833358625000000 0 0 0 0.183035467628336
0.7500301575000000 0.5833358625000000 0 0 0 0.682946534409448
0.1250311175000000 0.2083182225000000 0 0 0 0.233003477250229

抱歉,如果之前有人问过这个问题,我是 gnuplot 的新手。

我想问题是 set dgrid3d 和绘图 with vectors 在某种程度上不兼容。可能,gnuplot 也尝试对向量进行插值。 一种解决方法是将插值网格化表面绘制到数据块中,然后 unset dgrid3d。 好吧,你的矢量几乎不可见,当你旋转图形时,表面和底部的深度顺序仍然存在问题,到目前为止我无法解决。

代码:

# combining dgrid3d and vectors
reset session

$Data <<EOD
0.0000000020000000 0.0833272880000000 0 0 0 1.62609277247135e-09
0.5000000020000001 0.5833272880000000 0 0 0 0.965930741599645
0.8749688835000000 0.2083182225000000 0 0 0 0.233003475483508
0.3749688835000000 0.7083182225000000 0 0 0 0.732959928249388
0.7499740065000000 0.3333133385000000 0 0 0 0.612400228894737
0.2499740065000000 0.8333133384999999 0 0 0 0.353562980611359
0.6250021815000000 0.4583253445000000 0 0 0 0.915969987957243
0.1250021814999999 0.9583253445000000 0 0 0 0.0499605601370936
0.2500301575000000 0.0833358625000000 0 0 0 0.183035467628336
0.7500301575000000 0.5833358625000000 0 0 0 0.682946534409448
0.1250311175000000 0.2083182225000000 0 0 0 0.233003477250229
EOD

set dgrid3d 30,30,2
set pm3d at b 
set hidden3d

set table $Surface
    splot $Data u 1:2:6
unset table

unset dgrid3d

splot $Surface u 1:2:3 w l , \
      $Data u 1:2:3:4:5:6 w vectors lw 2 lc rgb "red"
### end of code

结果: