From d01464ccaa467069c07dec6a3d2d57e5d1c01e50 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 14 Sep 2023 07:11:30 -0400 Subject: [PATCH 1/3] Pass on idxs keyword argument from ensemble plots --- src/ensemble/ensemble_solutions.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ensemble/ensemble_solutions.jl b/src/ensemble/ensemble_solutions.jl index 265918f3e..b430d953d 100644 --- a/src/ensemble/ensemble_solutions.jl +++ b/src/ensemble/ensemble_solutions.jl @@ -139,7 +139,8 @@ end @recipe function f(sim::AbstractEnsembleSolution; zcolors = typeof(sim.u) <: AbstractArray ? fill(nothing, length(sim.u)) : nothing, - trajectories = eachindex(sim)) + trajectories = eachindex(sim), + idxs = nothing) for i in trajectories size(sim[i].u, 1) == 0 && continue @series begin @@ -148,6 +149,9 @@ end ylims --> (-Inf, Inf) zlims --> (-Inf, Inf) marker_z --> zcolors[i] + if idxs !== nothing + idxs ---> idxs + end sim[i] end end @@ -156,7 +160,8 @@ end @recipe function f(sim::EnsembleSummary; trajectories = typeof(sim.u[1]) <: AbstractArray ? eachindex(sim.u[1]) : 1, - error_style = :ribbon, ci_type = :quantile) + error_style = :ribbon, ci_type = :quantile, + idxs = nothing) if ci_type == :SEM if typeof(sim.u[1]) <: AbstractArray u = vecarr_to_vectors(sim.u) @@ -193,6 +198,9 @@ end legend --> false linewidth --> 3 fillalpha --> 0.2 + if idxs !== nothing + idxs ---> idxs + end if error_style == :ribbon ribbon --> (ci_low[i], ci_high[i]) elseif error_style == :bars From 871ada40af4c409cfbe8191509026741fb0c103f Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 14 Sep 2023 08:06:40 -0400 Subject: [PATCH 2/3] Update src/ensemble/ensemble_solutions.jl Co-authored-by: Qingyu Qu <52615090+ErikQQY@users.noreply.github.com> --- src/ensemble/ensemble_solutions.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ensemble/ensemble_solutions.jl b/src/ensemble/ensemble_solutions.jl index b430d953d..b74083b7c 100644 --- a/src/ensemble/ensemble_solutions.jl +++ b/src/ensemble/ensemble_solutions.jl @@ -199,7 +199,7 @@ end linewidth --> 3 fillalpha --> 0.2 if idxs !== nothing - idxs ---> idxs + idxs --> idxs end if error_style == :ribbon ribbon --> (ci_low[i], ci_high[i]) From bf3d605287af9003fe24a24289005f743e1bd71e Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 14 Sep 2023 08:06:44 -0400 Subject: [PATCH 3/3] Update src/ensemble/ensemble_solutions.jl Co-authored-by: Qingyu Qu <52615090+ErikQQY@users.noreply.github.com> --- src/ensemble/ensemble_solutions.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ensemble/ensemble_solutions.jl b/src/ensemble/ensemble_solutions.jl index b74083b7c..5d371269a 100644 --- a/src/ensemble/ensemble_solutions.jl +++ b/src/ensemble/ensemble_solutions.jl @@ -150,7 +150,7 @@ end zlims --> (-Inf, Inf) marker_z --> zcolors[i] if idxs !== nothing - idxs ---> idxs + idxs --> idxs end sim[i] end