# Makie - Plotting hatched polygons in CairoMakie

**URL:** <https://discourse.julialang.org/t/makie-plotting-hatched-polygons-in-cairomakie/74682>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [January 15, 2022, 8:13pm UTC](https://discourse.julialang.org/t/makie-plotting-hatched-polygons-in-cairomakie/74682 "2022-01-15T20:13:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pablo\_Marchant](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pablo_marchant/32/32828_2.png) [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Post date:** [January 15, 2022, 8:13pm UTC](https://discourse.julialang.org/t/makie-plotting-hatched-polygons-in-cairomakie/74682/1 "2022-01-15T20:13:58Z")

</div>

Hi!

I’m looking to reimplement various tools I have using python+matplotlib to julia+makie. Most of these deal with stellar astrophysics. One particular one is a plotting tool meant to post-process simulation data into one particular type of plot:

[https://github.com/orlox/mkipp](https://github.com/orlox/mkipp)

The core of what I need here is to make arbitrarily shaped hatched regions with holes. Using GLMakie I’ve found the snippet below can do the job:

```julia
using GLMakie
using Makie

f = Figure(resolution=(500,500))
Axis(f[1, 1])

pat = Makie.Pattern("+")

# polygon with hole
p = Makie.GeometryBasics.Polygon(
    Point2f[(0, 0), (3, 0), (3, 3), (0, 3)],
    [Point2f[(1.0, 1.0), (2.0, 1.0), (2.0, 2.0), (1.0, 2.0)]]
)

poly!(p, color=pat)

save("figure.png", f)

```

However, I need to use CairoMakie as well, since vector graphics support is important.The same code switched to CairoMakie gives me instead an error:

`Unsupported Color type: Makie.LinePattern{ColorTypes.RGBA{Float32}}`

Is this just a feature that is yet to be implemented in CairoMakie? If so, is there any workaround?

Thanks for any help!

---

<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 16, 2022, 7:50pm UTC](https://discourse.julialang.org/t/makie-plotting-hatched-polygons-in-cairomakie/74682/2 "2022-01-16T19:50:20Z")

</div>

It’s just not implemented, yes. If you want to try, it would probably not be too difficult to add a dispatch method for LinePattern with a Cairo implementation.
