# CairoMakie - Controlling radial axes in polar plots

**URL:** <https://discourse.julialang.org/t/cairomakie-controlling-radial-axes-in-polar-plots/122008>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [October 30, 2024, 5:13pm UTC](https://discourse.julialang.org/t/cairomakie-controlling-radial-axes-in-polar-plots/122008 "2024-10-30T17:13:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![togo59](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/togo59/32/4138_2.png) [@togo59](https://discourse.julialang.org/u/togo59)\
**Post date:** [October 30, 2024, 5:13pm UTC](https://discourse.julialang.org/t/cairomakie-controlling-radial-axes-in-polar-plots/122008/1 "2024-10-30T17:13:58Z")

</div>

I can’t quite fathom the logic CM uses for the radial axes interval for polar plots. The default seems to be 45 degrees, but if (say) the `thetalimits = (-pi/6 to +pi/6)`, the axes are at 10 degree intervals. In the documentation, I see other intervals, e.g. 15 degrees but I don’t see where they are chosen. I want to plot a function over `0..2pi` but I want to control the interval for the radial axes myself. I am sure this is a dumb question. I am using `Julia 1-11-1` with `CairoMakie v0.12.15`

E.g. This bit of code produces a 15 degree interval

```julia
using CairoMakie
fig = Figure()
ax = PolarAxis(fig[1, 1], thetalimits = (0, pi))
lines!(ax, range(0, pi, length=100), 10 .+ sin.(0.3 .* (1:100)))
fig

```

whereas this bit of code produces a 10 degree interval:

```julia
using CairoMakie
f = Figure(size = (600, 600))
ax = PolarAxis(f[1, 2], title = "thetalimits", thetalimits = (-pi/6, pi/6))
lines!(ax, range(0, 8pi, length=300), range(0, 10, length=300))
f

```

Roger

---

<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:** [October 30, 2024, 10:01pm UTC](https://discourse.julialang.org/t/cairomakie-controlling-radial-axes-in-polar-plots/122008/2 "2024-10-30T22:01:04Z")

</div>

The default for `thetaticks` is of type `AngularTicks`. That is basically a wrapper for the default tick finder just that it pretransforms radians to degrees and adds the degree symbol as a suffix. It tries to find “nice” ticks in the given limits, that’s why you get different intervals for different limits.

If you want to pass custom ticks the most basic thing that works is a tuple where the first argument is a vector of numbers (in radians) and the other is a vector of labels for those tick locations. That’s probably not documented more extensively because the mechanism is the same for Axis, Axis3 and Colorbar

---

<div class="post-metadata">

**Author:** ![togo59](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/togo59/32/4138_2.png) [@togo59](https://discourse.julialang.org/u/togo59)\
**Post date:** [October 31, 2024, 5:36pm UTC](https://discourse.julialang.org/t/cairomakie-controlling-radial-axes-in-polar-plots/122008/3 "2024-10-31T17:36:50Z")

</div>

@jules Many thanks for that. I did read the Axis and Axis3D sections before posting the question but didn’t find exactly what I wanted, probably it was there but my understanding is not great. But no worries, I re-read the documentation. Obviously, I could just create the data to produce the radial lines I wanted and hide everything else.

---

<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:** [October 31, 2024, 5:37pm UTC](https://discourse.julialang.org/t/cairomakie-controlling-radial-axes-in-polar-plots/122008/4 "2024-10-31T17:37:42Z")

</div>

No worries, it takes time to get used to the way Makie does things 🙂
