diff --git a/src/analysis/makieplots.jl b/src/analysis/makieplots.jl index 3422917dfab1061a52457d15f23f34c99168814b..691c7f9bc1e9e9940b100209a8a134e5a4ad4d20 100644 --- a/src/analysis/makieplots.jl +++ b/src/analysis/makieplots.jl @@ -39,12 +39,15 @@ Returns a Makie figure object. """ function populationtrends(model::AgentBasedModel) pops = model.datatables["populations"] + dates = @param(core.startdate):@param(core.enddate) f = Figure() - ax = Axis(f[1,1]) + ax = Axis(f[1,1], xlabel="Date", ylabel="Population size", + xtickformat = timeseries -> [Dates.format(dates[Int(d+1)], "dd/mm/yyyy") + for d in timeseries]) for s in unique(pops.Species) points = @select!(@subset(pops, :Species .== s), :Abundance) - lines!(f[1,1], Vector{Float32}(points.Abundance)) + lines!(f[1,1], Vector{Float32}(points.Abundance), linewidth=3, label=s) end - #TODO prettify, add legend & labels + axislegend("Species"; position=:lt) f end