# Gnuplot.jl polygon / patch plot

**URL:** <https://discourse.julialang.org/t/gnuplot-jl-polygon-patch-plot/87864>\
**Category:** General Usage\
**Tags:** gnuplot\
**Created:** [September 27, 2022, 8:59am UTC](https://discourse.julialang.org/t/gnuplot-jl-polygon-patch-plot/87864 "2022-09-27T08:59:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gravlax](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Post date:** [September 27, 2022, 8:59am UTC](https://discourse.julialang.org/t/gnuplot-jl-polygon-patch-plot/87864/1 "2022-09-27T08:59:30Z")

</div>

Dear all,  
I’m trying to generate a patch plot using Gnuplot.jl. The aim is to generate a figure with plenty of polygons filled with different colors. So first, I would like to get to plot one triangle filled wit a given color.  
To start with, I have found that very concise [gnuplot example](https://stackoverflow.com/questions/49054671/gnuplot-plotting-a-filled-surface-polygon-using-3-points):

```julia
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

```

However I’m not sure how this can be parse to Gnuplot.jl API. Is this supposed to do the job?

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

```

Also is this the way to go to generate patch plots with gnuplot? Or should one rather use `draw2d()` like in [this example](http://riotorto.users.sourceforge.net/Maxima/gnuplot/triangle/index.html)? I do not find that many examples of such plots using gnuplot.  
Thanks in advance for any potential hints!
