gnuplot使用3个点绘制填充曲面(多边形)

时间:2018-03-01 16:45:07

标签: gnuplot polygon

我正在尝试画一个三角形表面。我将表面的三个角设置为[1,0,1][0,1,1][1,1,0]。我这样做:

set view 57, 64
$data << EOD
1.000 0.000 1.000
0.000 1.000 1.000
1.000 1.000 0.000
1.000 0.000 1.000
EOD
set label 1 "C" font "Arial, 11" front at 1.100, 0.000, 1.100 
set label 2 "A" font "Arial, 11" front at 0.000, 1.050, 1.050
set label 3 "B" font "Arial, 11" front at 1.050, 1.050, 0.000
splot "$data" with lines lw 3 lc rgb 'black', \
    "< echo '1.000 0.000 1.000'" with points pt 7 lc rgb 'black', \
    "< echo '0.000 1.000 1.000'" with points pt 7 lc rgb 'black', \
    "< echo '1.000 1.000 0.000'" with points pt 7 lc rgb 'black'

我得到的情节是这样的: enter image description here

现在如何将多边形设为灰色或透明灰色?

1 个答案:

答案 0 :(得分:3)

一种方法是使用polygon对象:

set xrange [0:1]
set yrange [0:1]
set zrange [0:1]
set xyplane at 0
set view 69,74
set object 1 polygon from 1,0,1 to 0,1,1 to 1,1,0 fillstyle transparent solid 0.5
splot 1/0 notitle

enter image description here