# Axis padding

**URL:** <https://discourse.julialang.org/t/axis-padding/137904>\
**Category:** Visualization\
**Tags:** question, makie\
**Created:** [July 2, 2026, 1:54am UTC](https://discourse.julialang.org/t/axis-padding/137904 "2026-07-02T01:54:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/grero/32/109_2.png) [@grero](https://discourse.julialang.org/u/grero)\
**Post date:** [July 2, 2026, 1:54am UTC](https://discourse.julialang.org/t/axis-padding/137904/1 "2026-07-02T01:54:39Z")

</div>

Is there a way to pad an axis in Makie without modifying the data limits? I’m trying to use `brackets` to highlight a range in a heat map, like in the following little example.

```julia
using Makie

function bracket_test()
    fig = Figure()
    ax = Axis(fig[1,1])
    hh = heatmap!(ax, randn(30,17))
    bracket!(ax, [(Point2f(30.5, 1), Point2f(30.5, 6))];text=["Groupd"],style=:square, orientation=:down)
    xlims!(ax, 0.5, 33)
    fig
end

```

 ![bracket_test](https://global.discourse-cdn.com/julialang/original/3X/d/2/d24287dd90fba923682e4b5dd553841072fa53d0.png)

Here I had to artificially increase `xlims` to avoid the label getting cut off by the bounding box of the axis. The works, but it looks ugly with the extra bit of x-axis sticking out. Is there a way to achieve this without resorting to manipulating data limits? Is there a way to manually add some padding between the data limits and the bounding box of the axis?

---

<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 2, 2026, 3:54pm UTC](https://discourse.julialang.org/t/axis-padding/137904/2 "2026-07-02T15:54:32Z")

</div>

I would add a second axis and y link it to the first one. You have no limit problems and can simply set a `width` on the decoration axis to tweak its size. Hide the decorations and the spines and set the column gap between them to zero.

---

<div class="post-metadata">

**Author:** ![grero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/grero/32/109_2.png) [@grero](https://discourse.julialang.org/u/grero)\
**Post date:** [July 3, 2026, 12:37am UTC](https://discourse.julialang.org/t/axis-padding/137904/3 "2026-07-03T00:37:36Z")

</div>

Thanks Jules, that worked great!
