# Polar heatmap for angles between 0 and 90°?

**URL:** <https://discourse.julialang.org/t/polar-heatmap-for-angles-between-0-and-90/123743>\
**Category:** Visualization\
**Tags:** plots\
**Created:** [December 12, 2024, 9:00am UTC](https://discourse.julialang.org/t/polar-heatmap-for-angles-between-0-and-90/123743 "2024-12-12T09:00:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dutille](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@dutille](https://discourse.julialang.org/u/dutille)\
**Post date:** [December 12, 2024, 9:00am UTC](https://discourse.julialang.org/t/polar-heatmap-for-angles-between-0-and-90/123743/1 "2024-12-12T09:00:40Z")

</div>

Using Julia 1.11. In a perfect world I would expect the script below to deliver a heatmap in a quarter of disk. But I get a full disk. I tried to adjust the limits. since specifying ylim will adjust the range for the radius, i would expect xlim to set the range for the angles. But specifying xlim does not make any difference.

```julia
using Plots
rs=0:10. #radius
as=0:10:90 #angles
amp=[r for a in as, r in rs]
heatmap(as,rs, amp ; projection = :polar)

```

Any idea?

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [December 12, 2024, 12:09pm UTC](https://discourse.julialang.org/t/polar-heatmap-for-angles-between-0-and-90/123743/2 "2024-12-12T12:09:18Z")

</div>

You need to convert `as` from degrees to radians.

---

<div class="post-metadata">

**Author:** ![dutille](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@dutille](https://discourse.julialang.org/u/dutille)\
**Post date:** [December 12, 2024, 1:19pm UTC](https://discourse.julialang.org/t/polar-heatmap-for-angles-between-0-and-90/123743/3 "2024-12-12T13:19:52Z")

</div>

Thanks!

```julia
heatmap(as*π/180,rs, amp ; aspect_ratio=:equal, projection = :polar,xlim=(0,π/2))

```

Plots the heatmap in a quarter of disk, indeed.

However, the overall plot is still a disk with ticks running from 0 to 360°:

```julia
xticks!(:none) 

```

or

```julia
xticks!([0,π/2])

```

do not change the output.

---

<div class="post-metadata">

**Author:** ![mike.ingold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike.ingold/32/203749_2.png) [@mike.ingold](https://discourse.julialang.org/u/mike.ingold)\
**Post date:** [December 12, 2024, 3:28pm UTC](https://discourse.julialang.org/t/polar-heatmap-for-angles-between-0-and-90/123743/4 "2024-12-12T15:28:34Z")

</div>

Not an answer to your question, but a possible alternative: I’ve had pretty good luick using [Makie’s PolarAxis](https://docs.makie.org/v0.21/reference/blocks/polaraxis) for these kinds of plots, especially when very particular customizations are desired.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [December 12, 2024, 5:33pm UTC](https://discourse.julialang.org/t/polar-heatmap-for-angles-between-0-and-90/123743/5 "2024-12-12T17:33:32Z")

</div>

> [@dutille](#):
>
> However

However, [the one who seeks will find.](https://discourse.julialang.org/t/radar-plot-in-plots-jl-or-makie-jl/88576/4)
