GLMakie color gradient lines plots


I’m trying to find a way to make a figure with color gradient lines looked like this using GLMakie.
The figure is from here

The line plot has color gradient depending on the order of the lines.
Does anyone know how to make this done in GLMakie?

Here’s one way of doing it:

n = 10

f = Figure()
ax = Axis(f[1, 1])
for i in 1:n
    lines!(ax, 0..10, x -> sin(x) + i, color = i, colormap = :Blues, colorrange = (1, n), label = "$i")
Legend(f[1, 2], ax)

@jules Thank you very much! That’s so elegant! I really appreciate you!