在以下平凡的3D gnuplot散点图中,有两个点(标记为A和B)。不幸的是,由于这些点之间没有逻辑联系,因此无法直观地分辨出这些点在3D空间中的位置。
我想纠正的方法是在Z轴上向下添加垂直线到Z = 0地板平面,类似于下面的蓝色线(颜色无关),我用MS Paint拍了一下以说明我想要的东西:
这样就很容易看到,例如,A高于B。经过一些搜索之后,我还无法找到有关如何使用gnuplot实现此功能的任何信息。无论是RTFM指针还是如何实现这种绘图的现有示例,我都将不胜感激。
多亏墨菲定律,我终于在发布问题后偶然发现了答案。诀窍是with impulses
在splot
图形定义中使用,然后重新绘制相同的序列with points
以在脉冲线上获得交叉。这是(有些风格化)结果:
例如,下面是我用来生成上述内容的完整gnuplot脚本,尽管如上所述,该splot
行位于末尾,with impulses
并且with points
是回答问题的必要位。
set object rect from screen 0, screen 0 to screen 1, \
screen 1 fillcolor rgb "black" fillstyle solid 0.9 behind
set grid xtics ytics ztics mytics \
linetype 3 linewidth 0 linecolor rgb "#3366aa", \
linetype 3 linewidth 0 linecolor rgb "#3366aa"
set terminal postscript enhanced color size 10,4.9
set output "/path/to/graph.png"
set border linecolor rgb "#3366aa"
set xyplane 0
splot '/path/to/data' title "" with impulses linecolor rgb "#556600", \
'/path/to/data' title "" with points linecolor rgb "#eeff66"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句