I am having a strange problem with using LaTeX font for the axis and labels in Makie. In GLMakie@0.7.0
, the classic method of setting font=texfont()
works without issue. I can not get the axes and labels to use the same font in later versions (I am comparing to 0.8.2, for specificity). I can’t get v0.8.2 to use any font other than the default seen below, even swapping out the texfont()
for “New Computer Modern” or the full path on my system to the ttf file.
using GLMakie, MathTeXEngine
#=
Works with GLMakie@0.7.0
=#
fig = Figure(font = texfont())
ga = fig[1,1] = GridLayout()
axs = [ Axis(ga[1,1], ylabel="Label"), Axis(ga[2,1], xlabel=L"$ t $ [ms]", ylabel=L"Another Label $x$")]
save("./old_method.png",fig)
#=
Adapting for GLMakie@0.8.2
=#
fig = Figure(fonts = (; regular = texfont(), bold = texfont()))
ga = fig[1,1] = GridLayout()
axs = [ Axis(ga[1,1], ylabel="Label"), Axis(ga[2,1], xlabel=L"$ t $ [ms]", ylabel=L"Another Label $x$")]
save("./new_method.png",fig)
old_method.png
:
new_method.png
:
I’ve tested this on multiple machines and can not get the new method to present the axes and ticks with the texfont()
like the old method (pre-Makie 0.19’s font
to fonts
change). Wondering if anyone has figured out how to do so.