I am making a plot of a dataset using semi-transparent lines connecting a bunch of measurements. MWE:
using CairoMakie, Colors
CairoMakie.activate!(type = "svg")
a = β.abs.(randn(500))
b = a .* 0.5 .+ randn() / 10
c = b .* 0.5 .+ randn() / 20
f = Figure()
ax = Axis(f[1,1]; xticks = (1:3, ["a", "b", "c"]))
ylims!(ax, (0.0, nothing))
for (a, b, c) in zip(a, b, c)
lines!(ax, 1:3, [a, b, c]; color = colorant="0x1000")
end
f
Alternatively, (I think) you can also concatenate all data into one vector, but insert a NaN as a separator between the data sets. The NaN takes care that the lines are not connected then.
But I am not sure how much this would help CairoMakie or GLMakie performance wise.
And if you want to later make it interactive then this only seems to be hindering you in updating the values, because you would have to take the NaNs into account again β¦
The series recipe can be used to avoid manual NaN-business, which as Simon says is the most performant. Not sure if series actually does this under the hood, off the top of my head.
data = reduce(hcat, [(1:50) .+ i for i in 1:50])
series(data, solid_color = (:black, 0.1))