# How do I put the heatmap colorbar at the top of the plot?

**URL:** <https://discourse.julialang.org/t/how-do-i-put-the-heatmap-colorbar-at-the-top-of-the-plot/132893>\
**Category:** Visualization\
**Tags:** plots\
**Created:** [October 5, 2025, 5:51pm UTC](https://discourse.julialang.org/t/how-do-i-put-the-heatmap-colorbar-at-the-top-of-the-plot/132893 "2025-10-05T17:51:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [October 5, 2025, 5:51pm UTC](https://discourse.julialang.org/t/how-do-i-put-the-heatmap-colorbar-at-the-top-of-the-plot/132893/1 "2025-10-05T17:51:12Z")

</div>

using the Plots package.

I looked here: [Cannot change colorbar position](https://discourse.julialang.org/t/cannot-change-colorbar-position/17181), which does suggest that

```julia
heatmap(rand(5,5); cb=:top)

```

should work, however, it does not. Might be that it requires the pgfplot backend, but seems like osmething that might be possible using the default one?

---

<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:** [October 5, 2025, 7:07pm UTC](https://discourse.julialang.org/t/how-do-i-put-the-heatmap-colorbar-at-the-top-of-the-plot/132893/2 "2025-10-05T19:07:57Z")

</div>

> [@Torkel](#):
>
> which does suggest that
> 
> ```julia-auto
> heatmap(rand(5,5); cb=:top)
> 
> ```
> 
> should work,

It actually suggests that it should work for the pyplot() and pgfplotsx() backends, only.

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [October 6, 2025, 7:48am UTC](https://discourse.julialang.org/t/how-do-i-put-the-heatmap-colorbar-at-the-top-of-the-plot/132893/3 "2025-10-06T07:48:38Z")

</div>

Thanks! I was hoping by now it might have been available generally.
