# Move Colorbar to left

**URL:** <https://discourse.julialang.org/t/move-colorbar-to-left/116667>\
**Category:** New to Julia\
**Tags:** makie\
**Created:** [July 5, 2024, 2:40pm UTC](https://discourse.julialang.org/t/move-colorbar-to-left/116667 "2024-07-05T14:40:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Midez](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Midez](https://discourse.julialang.org/u/Midez)\
**Post date:** [July 5, 2024, 2:40pm UTC](https://discourse.julialang.org/t/move-colorbar-to-left/116667/1 "2024-07-05T14:40:22Z")

</div>

Hello, is it possible moving the Colorbar from left to right, that is to say switching it with the y axis ? I have nothing found in the docs as to how achieving this.

---

<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:** [July 5, 2024, 3:15pm UTC](https://discourse.julialang.org/t/move-colorbar-to-left/116667/2 "2024-07-05T15:15:01Z")

</div>

Do you mean `flipaxis`?

> **[Colorbar | Makie](https://docs.makie.org/stable/reference/blocks/colorbar#flipaxis)**
>
> Create impressive data visualizations with Makie, the plotting ecosystem for the Julia language. Build aesthetic plots with beautiful customizable themes, control every last detail of publication quality vector graphics, assemble complex layouts and...

---

<div class="post-metadata">

**Author:** ![Daniel\_Berge](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Daniel\_Berge](https://discourse.julialang.org/u/Daniel_Berge)\
**Post date:** [July 5, 2024, 3:22pm UTC](https://discourse.julialang.org/t/move-colorbar-to-left/116667/3 "2024-07-05T15:22:23Z")

</div>

Or do you mean to do something like this to make a Heatmap for example with the colorbar to the left, and the heatmap y axis ticks moved to the right?

```julia
fig = Figure()
ax = Axis(fig[1,1], yaxisposition=:right)
hm = heatmap!(ax, rand(1000,1000))
Colorbar(fig[1,end-1], hm)
fig

```

---

<div class="post-metadata">

**Author:** ![Midez](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Midez](https://discourse.julialang.org/u/Midez)\
**Post date:** [July 5, 2024, 3:25pm UTC](https://discourse.julialang.org/t/move-colorbar-to-left/116667/4 "2024-07-05T15:25:51Z")

</div>

Actually the solution below from Daniel\_Berge is exactly what I need. Never would have thought about that.

---

<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:** [July 5, 2024, 3:43pm UTC](https://discourse.julialang.org/t/move-colorbar-to-left/116667/5 "2024-07-05T15:43:55Z")

</div>

The `GridLayout` “indexing” doesn’t work like with an array. It’s made for convenience, and one idea is that you can extend the current grid by referencing rows or columns that don’t exist yet. It starts with one row and one column at position 1 by default. But you can add another column at index 0 as shown above (the `end-1`). But you can also do `Axis(fig[1, 2])` and `Colorbar(fig[1, 1])`, that has the same effect.
