# Hidedecorations not working as expected for PolarAxis?

**URL:** <https://discourse.julialang.org/t/hidedecorations-not-working-as-expected-for-polaraxis/126231>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [February 24, 2025, 4:34am UTC](https://discourse.julialang.org/t/hidedecorations-not-working-as-expected-for-polaraxis/126231 "2025-02-24T04:34:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/grero/32/109_2.png) [@grero](https://discourse.julialang.org/u/grero)\
**Post date:** [February 24, 2025, 4:34am UTC](https://discourse.julialang.org/t/hidedecorations-not-working-as-expected-for-polaraxis/126231/1 "2025-02-24T04:34:24Z")

</div>

I’m putting together a fairly complicated figure, involving a mixture of line plots and polar histogram plots. Using `PolarAxis` for the latter, I found that they appear to take up more space than needed. To illustrate the problem, I put together a simple example:

```julia
function polar_test()
   θ = range(-π, stop=π, length=100)
    r = 0.1 .+ rand(100)
    fig = Figure()
    lg1 = GridLayout(fig[1,1])
    ax1 = PolarAxis(lg1[1,1])
    scatter!(ax1, θ, r)
    Makie.Box(lg1[1,1],color = (:red, 0.0), strokewidth = 1)
    ax2 = Axis(lg1[1,2])
    scatter!(ax2, θ, r)
    Makie.Box(lg1[1,2],color = (:red, 0.0), strokewidth = 1)
    lg2 = GridLayout(fig[2,1])
    ax3 = PolarAxis(lg2[1,1], alignmode=Inside())
    hidedecorations!(ax3)
    scatter!(ax3, θ, r)
    Makie.Box(lg2[1,1],color = (:red, 0.0), strokewidth = 1)
    ax4 = Axis(lg2[1,2])
    Makie.Box(lg2[1,2],color = (:red, 0.0), strokewidth = 1)
    scatter!(ax4, θ, r)
    hidedecorations!(ax4)
    fig
end

polar_test()

```

 ![polar_axis_test](https://global.discourse-cdn.com/julialang/original/3X/9/7/9784770ffd368983c5dc026194970f08875717ba.jpeg)

For the normal `Axis` object (right column) hiding the decorations allocates more space for the plot in the grid layout, but for the `PolarAxis` (left column), the axis takes up the same amount of space. Is this a bug, or was it intended? Is there a quick fix to force the axis to take up the full space allotted to it by the layouting algorithm?

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [February 24, 2025, 6:50pm UTC](https://discourse.julialang.org/t/hidedecorations-not-working-as-expected-for-polaraxis/126231/2 "2025-02-24T18:50:00Z")

</div>

Hmm, it seems like the ticks are not integrated into protrusions in PolarAxis, so this might be an issue.

The quick fix is to set `polar_axis.thetaticklabelsize` and `polar_axis.rticklabelsize` to 0. That should get you most of the way there.

> <https://github.com/MakieOrg/Makie.jl/blob/b9e6e7a01b4f45cda632702efe674fbe09692f40/src/makielayout/blocks/polaraxis.jl#L138-L140>

So the alignmode etc can’t actually help, since they don’t know about the ticks.

Here’s an MWE stepping through what I did:

```julia
θ = range(-π, stop=π, length=100)
r = 0.1 .+ rand(100)

f, a, p = lines(r, θ; axis = (; type = PolarAxis))
b = Box(f[1, 1]; color = (:red, 0.3))
translate!(b, 0, 0, 10000) # get the box on top of the polar axis
f

```

 ![iTerm2.nGQfO9](https://global.discourse-cdn.com/julialang/original/3X/8/6/86aef505b80d8a965fc01d46af824769b03c2cf4.png)

```julia
hidedecorations!(a)

```

(this is still bad)

 ![iTerm2.AmOSVP](https://global.discourse-cdn.com/julialang/original/3X/2/0/2048a7a4cd778f19d2bed64f45d7c34e28263139.png)

```julia
a.thetaticklabelsize[] = 0
a.rticklabelsize[] = 0

```

 ![iTerm2.jjehFz](https://global.discourse-cdn.com/julialang/original/3X/4/c/4c41b8114a217d884ba821cb396113edd48b7207.png)  
It’s still not 100% tight, but at least mostly there. It would be great if you could open an issue on the Makie repo with this info!

---

<div class="post-metadata">

**Author:** ![grero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/grero/32/109_2.png) [@grero](https://discourse.julialang.org/u/grero)\
**Post date:** [February 25, 2025, 1:17am UTC](https://discourse.julialang.org/t/hidedecorations-not-working-as-expected-for-polaraxis/126231/3 "2025-02-25T01:17:42Z")

</div>

Thanks! The works like a charm.  
I have opened an issue here: [hidedecorations! for PolarAxis does not take protrusions into account · Issue #4822 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/4822)
