Skip to content

Commit

Permalink
Merge pull request #700 from jonathanfischer97/fix_ensemblesummary_plot
Browse files Browse the repository at this point in the history
Fix `EnsembleSummary` plot recipe kwarg #697
  • Loading branch information
ChrisRackauckas authored May 29, 2024
2 parents f2a9b0c + 11560bc commit de51914
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ext/SciMLBaseMakieExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/ensemble/ensemble_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit de51914

Please sign in to comment.