# Label with Latex in CairoMakie

**URL:** <https://discourse.julialang.org/t/label-with-latex-in-cairomakie/97619>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [April 18, 2023, 3:24pm UTC](https://discourse.julialang.org/t/label-with-latex-in-cairomakie/97619 "2023-04-18T15:24:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [April 18, 2023, 3:24pm UTC](https://discourse.julialang.org/t/label-with-latex-in-cairomakie/97619/1 "2023-04-18T15:24:59Z")

</div>

Hello!  
I tried place space between `E` and `(Hz)`, `I_0`, and `(Hz)` in the next code:

```julia
f = Figure(resolution = (1300, 600))

ax_bf = Axis(f[1,1]; ylabel = L"E (Hz)", xlabelsize = 35, ylabelsize = 35,
            xticklabelsize = 30, yticklabelsize = 30, xgridvisible = false, ygridvisible = false)
ax_lse = Axis(f[2, 1]; xlabel = L"I_0 (Hz)", ylabel = L"\Lambda _{1,2,3}", xlabelsize = 35, ylabelsize = 35,
            xticklabelsize = 30, yticklabelsize = 30, xgridvisible = false, ygridvisible = false)

f

```

As a result, the left bracket is removed. For space i use `\`  
Can this be fixed?

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [April 18, 2023, 4:07pm UTC](https://discourse.julialang.org/t/label-with-latex-in-cairomakie/97619/2 "2023-04-18T16:07:49Z")

</div>

I managed to get what I needed. To put it mildly, I am surprised that CairoMakie needs to be written in this way and that it does not recognize \

```julia
f = Figure(resolution = (1300, 600))

ax_bf = Axis(f[1,1]; ylabel = L"$E$ $(Hz)$", xlabelsize = 35, ylabelsize = 35,
            xticklabelsize = 30, yticklabelsize = 30, xgridvisible = false, ygridvisible = false)
ax_lse = Axis(f[2, 1]; xlabel = L"$I_0$ $(Hz)$", ylabel = L"\Lambda _{1,2,3}", xlabelsize = 35, ylabelsize = 35,
            xticklabelsize = 30, yticklabelsize = 30, xgridvisible = false, ygridvisible = false)

f

```

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [April 18, 2023, 7:22pm UTC](https://discourse.julialang.org/t/label-with-latex-in-cairomakie/97619/3 "2023-04-18T19:22:30Z")

</div>

The issue referenced below on how to escape spaces in LaTeXStrings may solve your problem:

> <https://github.com/JuliaStrings/LaTeXStrings.jl/issues/10>
>
> On Ubuntu 14.04, Julia v0.4.6, latexstring("a b") will remove the space characte…r and eventually produce the LaTeX string "ab" on a matplotlib figure, is that by design? I couldn't find a solution, neither "\\ " or ":" seemed to work, would you have an idea on how to fix this?
> 
> Many thanks,
