[Makie] How to plot a polygon with holes?

I am trying to plot polygons in Makie.jl, using the poly function. 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).

I can only help with GeometryBasics types :wink:

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

1 Like

The last example here is a set of polygons…

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

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