Change fonts using GLMakie

Hello :slight_smile:

I am trying to change the font style of my plot (I use GLMakie for plotting). I would like to change all (labels, titles …).
I tried that but it doesn’t work :confused:

# Figure : 
f = Figure(fontsize=26, font="Tahoma")
ax1 = GLMakie.Axis(f[1,1])
lines!(ax1, space_carbo,carbo_zone[:, 5000])
lines!(ax1, space_carbo,carbo_zone[:, 12000])

ax2 = GLMakie.Axis(f[2,1])
lines!(ax2, carbo_zone[501, :], color=RGBAf(0.0f0,0.61960787f0,0.4509804f0,1.0f0))
lines!(ax2, carbo_zone[843, :], color=RGBAf(0.8f0,0.4745098f0,0.654902f0,1.0f0))
f

Thanks,
NaSi

This works a bit differently, the defaults in Makie use :regular and :bold as their “fonts” and these are looked up in the fonts dictionary. So this works instead:

julia> f = Figure(fonts = (; regular = "Comic Sans", bold = "Comic Sans Bold"))
       Axis(f[1, 1], title = "Title")
       f

1 Like

Thanks ! it works great