GLMakie legend 2 columns

Hi there !

I am using GLMakie to plot some data and I would like to plot a legend with 2 colums. How can I do this ? Thanks :slight_smile:

    f = Figure(fontsize=26, fonts = (; regular = "Times New Roman"))
    ax1 = GLMakie.Axis(f[1,1],
    xlabel = "Time since start of CO₂ injection [days]", ylabel = "Strain [μϵ]",
    limits = ((0,findmax(time_test)[1]/3600/24), (-200,600)),
    xticks = 0:2:16, xminorticksvisible = true, xminorticks = IntervalsBetween(2),
    yminorticksvisible = true, yminorticks = IntervalsBetween(4))
    valuea = round(space_carbo[a],digits=3)
    valueb = round(space_carbo[b],digits=3)
    valuec = round(space_carbo[c],digits=3)
    valued = round(space_carbo[d],digits=3)
    lines!(ax1, time_test/3600/24,carbo_zone[a, :],linewidth=:2,label="$valuea m")
    lines!(ax1, time_test/3600/24,carbo_zone[b, :],linewidth=:2,label="$valueb m")
    lines!(ax1, time_test/3600/24,carbo_zone[c, :],linewidth=:2,label="$valuec m")
    lines!(ax1, time_test/3600/24,carbo_zone[d, :],linewidth=:2,label="$valued m")
    axislegend(position = :lt)
f

axislengend(..., nbanks = 2,). See here.

1 Like