Hi all. I am using CairoMakie.jl to plot a figure for longitudinal theophylline concentration data in 12 subjects simultaneously. The code I am using is
Theoph = dataset("datasets", "Theoph")
f = Figure()
Axis(f[1,1])
CairoMakie.lines!(Theoph.Time, Theoph.Conc)
CairoMakie.scatter!(Theoph.Time, Theoph.Conc)
f
I can be more specific if you tell me more about the format of Theoph, but I would recommend adding the AlgebraOfGraphics package to make plotting datasets easier. Something like:
using AlgebraOfGraphics, CairoMakie
draw(data(Theoph) * mapping(:Time, :Conc, color=:Subject) * visual(ScatterLines))
Second the advice to use AlgebraOfGraphics. It saves you exactly from the annoyance of writing out the grouping logic for these kinds of plots over and over again.
Makie is more low level, grouping a dataframe and automatically creating a legend is currently outside of its scope. But you can create more flexible solutions than with a framework like AlgebraOfGraphics. And you can simply combine both, AlgebraOfGraphics creates normal Makie plots that you can modify further.