Label with Latex in CairoMakie

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

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?

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 \

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

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

1 Like