我一直找不到找到标题中描述的情节的方法,有没有人知道如何做到这一点?我想从函数中绘制表面,从文件中绘制点,并在这些点和表面之间绘制线条。下面的链接是一个图像,其中包含我想做的事的一个示例,该示例取自于一个相同任务(但是用于另一个绘图程序)的stackoverflow问题。
您可以在gnuplot的using
语句中进行计算。对于线条,我使用vectors
绘图样式,并使用arrowstyle variable
(或linecolor variable
)可以根据dz
值选择不同的颜色:
set style arrow 1 linecolor rgb 'red' nohead
set style arrow 2 linecolor rgb 'green' nohead
splot f(x,y) with lines, \
'points.dat' using 1:2:(f($1,$2)):(0):(0):(dz=$3-f($1,$2)):(dz < 0 ? 1 : 2) with vectors arrowstyle variable,\
'' using 1:2:3 with points pt 7 ps 5
我不确定,这会给gnuplot 4.6带来问题。对于您的情况,您还可以使用linecolor variable
或linecolor rgb variable
更改垂直线的颜色:
splot f(x,y) with lines, \
'points.dat' using 1:2:(f($1,$2)):(0):(0):(dz=$3-f($1,$2)):(dz < 0 ? 0xff0000 : 0x00ff00) with vectors nohead linecolor rgb variable lw 5,\
'' using 1:2:3 with points pt 7 ps 5
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句