# \[Makie\] How to plot a polygon with holes?

**URL:** https://discourse.julialang.org/t/makie-how-to-plot-a-polygon-with-holes/53565
**Category:** New to Julia
**Tags:** makie, polygons
**Created:** [January 18, 2021, 10:19pm UTC](https://discourse.julialang.org/t/makie-how-to-plot-a-polygon-with-holes/53565 "2021-01-18T22:19:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![circonflexe](https://avatars.discourse-cdn.com/v4/letter/c/c57346/32.png) [@circonflexe](https://discourse.julialang.org/u/circonflexe)
#### Post date: [January 18, 2021, 10:19pm UTC](https://discourse.julialang.org/t/makie-how-to-plot-a-polygon-with-holes/53565/1 "2021-01-18T22:19:03Z")

</div>

I am trying to plot polygons in `Makie.jl`, using the [`poly` function](http://makie.juliaplots.org/stable/plotting_functions.html#poly). The documentation for that function is quite terse, to say the least. Does anybody have an example on hand of plotting custom polygons, or unions of polygons, or polygons with holes?

(As a bonus question, is it possible to pass data to `poly` without using the `GeometryBasics` types? For various reasons, I would prefer avoiding this package if possible).

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [January 18, 2021, 10:44pm UTC](https://discourse.julialang.org/t/makie-how-to-plot-a-polygon-with-holes/53565/2 "2021-01-18T22:44:13Z")

</div>

I can only help with GeometryBasics types 😉

```julia
using AbstractPlotting.GeometryBasics

p = Polygon(Point2f0[(0, 0), (0, 1), (1, 1), (1, 0)], [Point2f0[(0.2, 0.2), (0.2, 0.8), (0.8, 0.8), (0.8, 0.2)]])
poly(p)

```

The arguments of the polygon are the outline, then a vector of hole outlines

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/8/0/8062bf41073ab6eb80be083d5a496b39c209eefe.png)

---

<div class="post-metadata">

### Author: ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)
#### Post date: [January 19, 2021, 12:53am UTC](https://discourse.julialang.org/t/makie-how-to-plot-a-polygon-with-holes/53565/3 "2021-01-19T00:53:25Z")

</div>

The last example here is a set of polygons…

> **[Jupyter Notebook Viewer](https://nbviewer.org/github/lazarusA/MakieNotebooks/blob/main/FigGlowCircle.ipynb)**
>
> Check out this Jupyter notebook!

 ![poly](https://global.discourse-cdn.com/julialang/original/3X/d/4/d41afd6642a99edacfc7255e6ce8555822a47e1e.png)

`poly!((x,y), args...)`

where x and y are the coordinates of the polygon… And no need for GeometryBasics up to this point.
