【发布时间】:2018-11-22 04:23:11
【问题描述】:
以gnuplotting entry 为灵感,我正在尝试创建一个 3d 直方图,如下所示:
但是,在高角度视图下,depthorder 不受尊重:
用于生成绘图的 gnuplot(5.2 版)命令包括:
set terminal pngcairo enhanced size 800,600
set output "cube_depthorder.png"
set cbrange [0:10]
set palette defined ( 1 '#ff4c4d', 2 '#ce4c7d', 3 '#ae559e', 4 '#df866d', 5 '#ffb66d', 6 '#ffe7cf', 7 '#cecece', 8 '#6d6d6d', 9 '#4c4c8e', 10 '#4c4cef' )
set view 60,45,1,1
set xrange [-0.09:1.99]
set xyplane at 0
set yrange [-0.1125:2.0125]
set pm3d at s depthorder border
unset colorbox
splot "-" binary record=(5,4) format="%double%double%double" using 1:2:3 notitle with lines dt solid linecolor rgb "black " , "-" binary record=(5,4) format="%double%double%double" using 1:2:3 notitle with lines dt solid linecolor rgb "black " , "-" binary record=(5,4) format="%double%double%double" using 1:2:3 notitle with lines dt solid linecolor rgb "black " , "-" binary record=(5,4) format="%double%double%double" using 1:2:3 notitle with lines dt solid linecolor rgb "black "
如图所示,splot 命令包含四个条目。在将它们发送到 splot 之前,我尝试将这些条目从最高到最短排序,但这在 depthorder 上没有任何变化。
我怀疑depthorder 测量从中心到绘图视口的四边形并按距离排序。然后有一个角度,高四边形的中心比较短的四边形更近,因此以不同的顺序绘制。
这种怀疑是正确的,还是这里有其他问题?在这种情况下,是否有解决方案可以“正确”测量 depthorder?
对于那些希望重新创建这些图表的人,这里有一个包含等值线的数据文件(每条线是五个 (x,y,z) 点,每个立方体有 4 条线(2 条水平线和 2 条垂直线),以及四个立方体):
0 1 0
0 1.9 0
0 1.9 2
0 1 2
0 1 0
1 1 0
1 1.9 0
1 1.9 1
1 1 1
1 1 0
0 0 0
0 0.9 0
0 0.9 1
0 0 1
0 0 0
1 0 0
1 0.9 0
1 0.9 0
1 0 0
1 0 0
0.9 1 0
0.9 1.9 0
0.9 1.9 2
0.9 1 2
0.9 1 0
1.9 1 0
1.9 1.9 0
1.9 1.9 1
1.9 1 1
1.9 1 0
0.9 0 0
0.9 0.9 0
0.9 0.9 1
0.9 0 1
0.9 0 0
1.9 0 0
1.9 0.9 0
1.9 0.9 0
1.9 0 0
1.9 0 0
0 1 0
0 1.9 0
0.9 1.9 0
0.9 1 0
0 1 0
1 1 0
1 1.9 0
1.9 1.9 0
1.9 1 0
1 1 0
0 0 0
0 0.9 0
0.9 0.9 0
0.9 0 0
0 0 0
1 0 0
1 0.9 0
1.9 0.9 0
1.9 0 0
1 0 0
0 1 2
0 1.9 2
0.9 1.9 2
0.9 1 2
0 1 2
1 1 1
1 1.9 1
1.9 1.9 1
1.9 1 1
1 1 1
0 0 1
0 0.9 1
0.9 0.9 1
0.9 0 1
0 0 1
1 0 0
1 0.9 0
1.9 0.9 0
1.9 0 0
1 0 0
【问题讨论】: