# How To Make Concentric Polar Axes with Custom Band Size in Makie?

**URL:** https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137
**Category:** General Usage
**Tags:** question, plotting, makie
**Created:** [July 28, 2025, 3:38pm UTC](https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137 "2025-07-28T15:38:49Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)
#### Post date: [July 28, 2025, 3:38pm UTC](https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137/1 "2025-07-28T15:38:49Z")

</div>

Hi folks! 👋

On the part of my ongoing quest: [Building a Julia-Powered E-Ink Dashboard: A Dev Log - #11 by TheCedarPrince](https://discourse.julialang.org/t/building-a-julia-powered-e-ink-dashboard-a-dev-log/130709/11)

I would like to make multiple polar axes concentric with custom band widths. Here are two polar axes I have:

Temperature data:

 ![display](https://global.discourse-cdn.com/julialang/original/3X/a/8/a852eb0f1b80b959dea856b6f6ab7dbbb04433a3.png)

Wind data:

 ![display](https://global.discourse-cdn.com/julialang/original/3X/6/5/65ee9609f8d504afeb0b8e6c1ec331e0af8c5f9c.png)

* * *

As an example, what I would like to do is put the wind data polar axis within the temperature polar axis plots I have made. What I do not know is the following:

1. How to link the same center for polar axes across multiple different polar axes
2. How to control the width of bands formed between the distance of the outer and inner radius of the polar axis (say like 1.5cm or something like that)
3. How to stack polar axes together in one plot.

In an ideal world for 2, I would like to have something like this:

```julia
ax = PolarAxis(
    f[1, 1], 
    bandwidth = .25
)

```

Where the `.25` corresponds extending 25% of the band’s size from the outside radius to the center. And then you could say `.5` for a bandwidth that is halfway to the center, etc.

* * *

Any thoughts on how to do this?

Thanks!

~ tcp 🌳

---

<div class="post-metadata">

### Author: ![JonasWickman](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@JonasWickman](https://discourse.julialang.org/u/JonasWickman)
#### Post date: [July 28, 2025, 8:50pm UTC](https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137/2 "2025-07-28T20:50:03Z")

</div>

I would’ve thought something like this should have worked:

```julia-auto
fig = Figure()
ax = PolarAxis(fig[1,1]; rlimits = (5.0, 10.0))
lines!(ax, range(0, 2π; length = 101), fill(6.0, 101))

ax_inset = PolarAxis(fig[1,1];
    rlimits = (0.0, 3.0),
    width=Relative(0.3),
    height=Relative(0.3),
    halign=0.5,
    valign=0.5
)
lines!(ax_inset, range(0, 2π; length = 101), fill(2.0, 101))

translate!(ax_inset.blockscene, 0, 0, 150)
fig

```

but it doesn’t quite, it produces this:

 ![polar](https://global.discourse-cdn.com/julialang/original/3X/6/f/6f569144b451c3ee461216c9d52a904e2102ce52.png)

It might be possible to fiddle with how individual elements are z-translated to get it to work, but perhaps polar insets are not quite supported.

Edit:

```julia-auto
[e9467ef8] GLMakie v0.13.4
[ee78f7c6] Makie v0.24.4
Julia Version 1.11.6
OS: Windows (x86_64-w64-mingw32)

```

---

<div class="post-metadata">

### Author: ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)
#### Post date: [July 28, 2025, 10:07pm UTC](https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137/3 "2025-07-28T22:07:19Z")

</div>

Yea, that’s what I have also learned with tinkering… I am also just not quite sure how to make it work.

Thanks for trying a hand at this here @JonasWickman!

---

<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: [July 29, 2025, 7:16am UTC](https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137/4 "2025-07-29T07:16:32Z")

</div>

The problem is that Makie doesn’t have arbitrary clip paths, so the clipping of PolarAxis is done with an opaque polygon, which is the one covering your inset

---

<div class="post-metadata">

### Author: ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)
#### Post date: [July 29, 2025, 3:44pm UTC](https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137/5 "2025-07-29T15:44:30Z")

</div>

Oh interesting. So, would there be any way to achieve what I am trying to do with Makie? Or what would it take to get this working within Makie?

---

<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: [July 29, 2025, 5:25pm UTC](https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137/6 "2025-07-29T17:25:18Z")

</div>

as long as no data actually clips outside it might work to just hide the clip polygon

---

<div class="post-metadata">

### Author: ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)
#### Post date: [July 29, 2025, 5:38pm UTC](https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137/7 "2025-07-29T17:38:12Z")

</div>

Oh that’s great! So would I want to play around with these settings:

- [Polar Axis Clip Settings](https://docs.makie.org/stable/reference/blocks/polaraxis#clip)
- [Plotting outside a PolarAxis​](https://docs.makie.org/stable/reference/blocks/polaraxis#Plotting-outside-a-PolarAxis)

Or is it something more fundamental @jules?

---

<div class="post-metadata">

### Author: ![JonasWickman](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@JonasWickman](https://discourse.julialang.org/u/JonasWickman)
#### Post date: [July 30, 2025, 2:49pm UTC](https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137/8 "2025-07-30T14:49:54Z")

</div>

For future reference (my own if nothing else), setting `clip = false` does indeed do the trick.

```julia-auto
using GLMakie
fig = Figure()
ax = PolarAxis(fig[1,1]; rlimits = (5.0, 10.0), clip = false)
lines!(ax, range(0, 2π; length = 101), fill(6.0, 101))

ax_inset = PolarAxis(fig[1,1];
    rlimits = (0.0, 3.0), clip = false,
    width=Relative(0.3),
    height=Relative(0.3),
    halign=0.5,
    valign=0.5
)
lines!(ax_inset, range(0, 2π; length = 101), fill(2.0, 101))

fig

```

 ![polar_2](https://global.discourse-cdn.com/julialang/original/3X/a/c/ac9fae6c610c389e1dc5ddcce45cc8408ea63f37.png)

---

<div class="post-metadata">

### Author: ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)
#### Post date: [August 3, 2025, 6:32pm UTC](https://discourse.julialang.org/t/how-to-make-concentric-polar-axes-with-custom-band-size-in-makie/131137/9 "2025-08-03T18:32:56Z")

</div>

After much experimentation, I did indeed find that your suggestions worked wonders here @JonasWickman ! 😃 What I ended up doing is making the rlimits of each PolarAxis break up between 0, 3.33, 6.66, 10 to create reasonably sized bandwidths. Here’s an example of a plot I made; still need to tweak the layout to make it cleaner, but it captures the vision:

 ![poc](https://global.discourse-cdn.com/julialang/original/3X/2/3/23ee66a616b59adbed58a279259eda24f1da76a7.png)

* * *

For future reference, here is what the code looks like. Folks can adapt it however they see fit:

```julia
using CairoMakie
f = Figure(
    size = (240, 240)
);

# Scale data in-between band ranges
function scale_vals(data, r)
    r_min = minimum(data)
    r_max = maximum(data)
    t_min = r[1]
    t_max = r[2]

    [(m - r_min)/(r_max - r_min) * (t_max - t_min) + t_min for m in data]
end

# Outside ring
ax = PolarAxis(
    f[1, 1], 
    width = 200,
    height = 240,
    rminorgridvisible = false,
    rminorticksvisible = false,
    rgridvisible = false,
    rticks = LinearTicks(2),
    rticklabelsize = 10,
    rticklabelsvisible = false,
    rgridcolor = :blue,
    rlimits = (6.66, 10),
    thetaminorticksvisible = false,
    thetaticks = (collect(-3pi/2:15 * pi / 180:pi/2)[1:end-1], vcat("0", ["$x" for x in 23:-1:1])),
    thetaticklabelsize = 14,
    thetaminorticks = IntervalsBetween(3),
    thetagridcolor = :black,
    thetagridvisible = false,
    thetagridwidth = 1,
    clip = false
)

scatter!(ax, collect(-3pi/2:15 * pi / 180:pi/2)[1:end-1], scale_vals(reverse(hourly_vars["wind_speed_10m"]), ax.rlimits.val), color = :black, markersize = 12, marker = '↑', rotation = hourly_vars["wind_direction_10m"] .* (pi / 180))

# Middle ring
ax = PolarAxis(
    f[1, 1],
    width=120,
    height=120,
    rminorgridvisible = false,
    rminorticksvisible = false,
    rgridvisible = false,
    rticks = LinearTicks(2),
    rticklabelsize = 10,
    rticklabelsvisible = false,
    rgridcolor = :blue,
    rlimits = (3.33, 6.66),
    thetaminorticksvisible = false,
    thetaticks = (collect(-3pi/2:15 * pi / 180:pi/2)[1:end-1], vcat("0", ["$x" for x in 23:-1:1])),
    thetaticklabelsize = 10,
    thetaticklabelsvisible = false,
    thetaminorticks = IntervalsBetween(3),
    thetagridcolor = :black,
    thetagridvisible = false,
    thetagridwidth = 1,
    clip = false,
)

norm_val = ax.rlimits.val[1] / minimum(hourly_vars["temperature_2m"]) 

scatter!(ax, collect(-3pi/2:15 * pi / 180:pi/2)[1:end-1], scale_vals(reverse(hourly_vars["temperature_2m"]), ax.rlimits.val), color = :black, markersize = 8, marker = markers)

# Inside ring
ax = PolarAxis(
    f[1,1];
    width=70,
    height=70,
    rlimits = (0, 3.33),
    rminorgridvisible = false,
    rminorticksvisible = false,
    rgridvisible = false,
    rticks = LinearTicks(2),
    rticklabelsize = 10,
    rticklabelsvisible = false,
    rgridcolor = :blue,
    thetaminorticksvisible = false,
    thetaticks = (collect(-3pi/2:15 * pi / 180:pi/2)[1:end-1], vcat("0", ["$x" for x in 23:-1:1])),
    thetaticklabelsvisible = false,
    thetaminorticks = IntervalsBetween(3),
    thetagridcolor = :black,
    thetagridvisible = false,
    thetagridwidth = 1,
    clip = false,
);

p = barplot!(ax, collect(-3pi/2:15 * pi / 180:pi/2)[1:end-1], rand(0:.1:3.33, 24))
pp = popat!(p.plots, findfirst(x -> x isa Poly, p.plots))
polys = map(pp[1].value) do rects
    map(rects) do rect
        N_steps = 100
        mini = minimum(rect); maxi = maximum(rect)
        ps = Point2f[mini, Point2f(mini[1], maxi[2]), maxi, Point2f(maxi[1], mini[2]), mini]
        ps = map(range(0, 4, length = N_steps)) do f
            ps[1] * max(0, 1-f) + 
            ps[2] * max(0, 1 - abs(f-1)) + 
            ps[3] * max(0, 1 - abs(f-2)) + 
            ps[4] * max(0, 1 - abs(f-3)) + 
            ps[5] * max(0, 1 - abs(f-4))
        end
        Makie.Polygon(ps)
    end
end
poly!(p, attributes(pp), polys[1], strokecolor = :black, strokewidth = 2, color = :black)

```
