Skip to content

Commit

Permalink
Pass on idxs keyword argument from ensemble plots
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Sep 14, 2023
1 parent 73eb334 commit d01464c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ensemble/ensemble_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d01464c

Please sign in to comment.