# \[Makie\] Colorbar positioning woes

**URL:** <https://discourse.julialang.org/t/makie-colorbar-positioning-woes/88465>\
**Category:** Visualization\
**Tags:** plotting, makie\
**Created:** [October 9, 2022, 3:03am UTC](https://discourse.julialang.org/t/makie-colorbar-positioning-woes/88465 "2022-10-09T03:03:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AstroBarker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/astrobarker/32/15170_2.png) [@AstroBarker](https://discourse.julialang.org/u/AstroBarker)\
**Post date:** [October 9, 2022, 3:03am UTC](https://discourse.julialang.org/t/makie-colorbar-positioning-woes/88465/1 "2022-10-09T03:03:09Z")

</div>

Hey folks,  
I am having trouble setting up a colorbar. The plot is set with `aspect = DataAspect()` and is quite rectangular. The colorbar then appears very far from the actual plot (see below). How can I remedy this so that the colorbar is at a decent location? Currently, I simply call `Colarbar( fig[1,2], limits=...)`.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/e/eec1fd50e168e871287dce17bf8f42bed84ae86f.jpeg)

Thanks!

---

<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 9, 2022, 5:47am UTC](https://discourse.julialang.org/t/makie-colorbar-positioning-woes/88465/2 "2022-10-09T05:47:40Z")

</div>

Have a look at this tutorial [Aspect ratio and size control tutorial](https://docs.makie.org/stable/tutorials/aspect-tutorial/)

---

<div class="post-metadata">

**Author:** ![AstroBarker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/astrobarker/32/15170_2.png) [@AstroBarker](https://discourse.julialang.org/u/AstroBarker)\
**Post date:** [October 9, 2022, 4:28pm UTC](https://discourse.julialang.org/t/makie-colorbar-positioning-woes/88465/3 "2022-10-09T16:28:20Z")

</div>

Thanks, this is exactly what I needed! I am curious, I am getting an error that `resize_to_layout!()` is not defined. Has its usage been changed? It’s not a huge deal as I found a decent resolution setting, I’m just curious as it seems convenient for quick exploratory plotting.

---

<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 9, 2022, 7:56pm UTC](https://discourse.julialang.org/t/makie-colorbar-positioning-woes/88465/4 "2022-10-09T19:56:40Z")

</div>

You’re on an older version, it’s evident by the Dejavu font in your example picture, we use a different one now 🙂

---

<div class="post-metadata">

**Author:** ![AstroBarker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/astrobarker/32/15170_2.png) [@AstroBarker](https://discourse.julialang.org/u/AstroBarker)\
**Post date:** [October 9, 2022, 8:06pm UTC](https://discourse.julialang.org/t/makie-colorbar-positioning-woes/88465/5 "2022-10-09T20:06:13Z")

</div>

Ah that I am – thanks again!!
