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

问题描述 投票:1回答:1

我想画一个三角形表面。我设置表面的三个角落为[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

现在我如何使多边形变为灰色或透明灰色?

gnuplot polygon
1个回答
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

© www.soinside.com 2019 - 2024. All rights reserved.