# Text outside of Axis with Makie

**URL:** <https://discourse.julialang.org/t/text-outside-of-axis-with-makie/97888>\
**Category:** General Usage\
**Tags:** question, plotting, makie\
**Created:** [April 25, 2023, 8:20am UTC](https://discourse.julialang.org/t/text-outside-of-axis-with-makie/97888 "2023-04-25T08:20:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielVandH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielvandh/32/31134_2.png) [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Post date:** [April 25, 2023, 8:20am UTC](https://discourse.julialang.org/t/text-outside-of-axis-with-makie/97888/1 "2023-04-25T08:20:31Z")

</div>

Is it possible, using Makie.jl, to add text outside of an axis? For instance, in

```julia
using CairoMakie
fig = Figure()
ax = Axis(fig[1, 1])

```

![image](https://global.discourse-cdn.com/julialang/original/3X/4/6/469aa89e931e6c27235b18044c7052e8f9e2f67f.png)

I want to add text right on the top-left on the plot outside of the axis itself. I tried e.g.

```julia
text!(ax, -5, 10; text = L"$ $Upper")

```

but of course that just changes the axis limits and puts it inside.

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [April 25, 2023, 8:59am UTC](https://discourse.julialang.org/t/text-outside-of-axis-with-makie/97888/2 "2023-04-25T08:59:43Z")

</div>

Something like this?

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/7/d72d01d3cf1cd6d055fb007a28bbe396f938b9c4.png)

```julia
let 
    fig = Figure()
    xs = 1:10
    ax, plt = scatter(fig[1, 1], xs, xs.^2)
    Label(fig[0, 0], "Test")
    display(fig)
end

```

There is also A LOT of detail on how to do this in the [layout tutorial](https://docs.makie.org/stable/tutorials/layout-tutorial/), where they go through, in complete detail on why and how, to make the following plot:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/8/68636eb3bd62f544bc9cf35dea09d33fee6b4aa2.jpeg)

---

<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:** [April 25, 2023, 8:59am UTC](https://discourse.julialang.org/t/text-outside-of-axis-with-makie/97888/3 "2023-04-25T08:59:47Z")

</div>

Here are two options:

```julia
f = Figure()
Axis(f[1, 1], title = "Some text", titlealign = :left)
Axis(f[1, 2])
Label(f[1, 2, Top()], "Some Text", halign = :left)
f

```

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/c/f/cff4602625bbdaf64de3fbc1d6d3e1547e8d9ec7.jpeg)
