From bbdd876ebb77365de6558e2b2aa640248300e2c9 Mon Sep 17 00:00:00 2001 From: Jonathan Fischer Date: Tue, 28 May 2024 13:01:21 -0400 Subject: [PATCH 1/2] Fix `EnsembleSummary` plot recipe `idxs` kwarg `EnsembleSummary`'s plot recipe refered to the variable indices as `trajectories`, likely typo from the `EnsembleSimulation` recipe above where that nomenclature made sense. Fixed it to use `idxs`, allowing users to select which variables to plot the summaries of, in line with the documentation. --- src/ensemble/ensemble_solutions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ensemble/ensemble_solutions.jl b/src/ensemble/ensemble_solutions.jl index 7c9529b67..b2294ea25 100644 --- a/src/ensemble/ensemble_solutions.jl +++ b/src/ensemble/ensemble_solutions.jl @@ -158,7 +158,7 @@ end end @recipe function f(sim::EnsembleSummary; - trajectories = sim.u.u[1] isa AbstractArray ? eachindex(sim.u.u[1]) : + idxs = sim.u.u[1] isa AbstractArray ? eachindex(sim.u.u[1]) : 1, error_style = :ribbon, ci_type = :quantile) if ci_type == :SEM @@ -192,7 +192,7 @@ end else error("ci_type choice not valid. Must be `:SEM` or `:quantile`") end - for i in trajectories + for i in idxs @series begin legend --> false linewidth --> 3 From 11560bc27e03eb586099b0d36da5dbf4451c8d97 Mon Sep 17 00:00:00 2001 From: Jonathan Fischer Date: Tue, 28 May 2024 13:08:32 -0400 Subject: [PATCH 2/2] Update `Makie` plot recipe kwargs for `EnsembleSummary` `EnsembleSummary`'s plot recipe refered to the variable indices as `trajectories`, likely typo from the `EnsembleSimulation` recipe above where that nomenclature made sense. Fixed it to use `idxs`, allowing users to select which variables to plot the summaries of, in line with the documentation. --- ext/SciMLBaseMakieExt.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/SciMLBaseMakieExt.jl b/ext/SciMLBaseMakieExt.jl index 24c6e2c21..65acbe2c8 100644 --- a/ext/SciMLBaseMakieExt.jl +++ b/ext/SciMLBaseMakieExt.jl @@ -344,7 +344,7 @@ end # TODO: should `error_style` be Makie plot types instead? I.e. `Band`, `Errorbar`, etc function Makie.convert_arguments(::Type{<:Lines}, sim::SciMLBase.EnsembleSummary; - trajectories = sim.u.u[1] isa AbstractArray ? eachindex(sim.u.u[1]) : + idxs = sim.u.u[1] isa AbstractArray ? eachindex(sim.u.u[1]) : 1, error_style = :ribbon, ci_type = :quantile, kwargs...) @@ -384,7 +384,7 @@ function Makie.convert_arguments(::Type{<:Lines}, makie_plotlist = Makie.PlotSpec[] - for (count, idx) in enumerate(trajectories) + for (count, idx) in enumerate(idxs) push!(makie_plotlist, S.Lines(sim.t, u[idx]; color = Makie.Cycled(count), label = "u[$idx]")) if error_style == :ribbon