I want to make a 3D surface plot in Makie, and I need the z-axis label to be formatted with \LaTeX. Whenever I add such a label, all the content in the plot disappears. For example, the following plot works without adding an L
prefix to the z-label:
using CairoMakie
x = collect(-2:0.01:2)
y = collect(-2:0.01:2)
Z = [1/(1+(x+im*y)^2) for y in y, x in x]
fig = Figure()
ax = Axis3(fig[1, 1], zlabel = "|1/(1+z^2)|")
surface!(ax, x, y, abs.(Z))
zlims!(ax, 0, 5)
Once I try and format the z-label into \LaTeX:
x = collect(-2:0.01:2)
y = collect(-2:0.01:2)
Z = [1/(1+(x+im*y)^2) for y in y, x in x]
fig = Figure()
ax = Axis3(fig[1, 1], zlabel = L"|1/(1+z^2)|")
surface!(ax, x, y, abs.(Z))
zlims!(ax, 0, 5)
everything in the plot disappears.
Am I doing something wrong here, or is there a way around this?