ramgorur
ramgorur

Reputation: 2164

gnuplot plotting a filled surface (polygon) using 3 points

I am trying to draw a triangular surface. I am setting three corners of the surface as [1,0,1], [0,1,1] and [1,1,0]. I am doing like this:

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'

and the plot I am getting is like this: enter image description here

Now how do I make the polygon grey or transparent grey?

Upvotes: 2

Views: 1516

Answers (1)

user8153
user8153

Reputation: 4095

One way to do that is by using a polygon object:

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

Upvotes: 4

Related Questions