Skip to content

Commit de51914

Browse files
Merge pull request #700 from jonathanfischer97/fix_ensemblesummary_plot
Fix `EnsembleSummary` plot recipe kwarg #697
2 parents f2a9b0c + 11560bc commit de51914

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/SciMLBaseMakieExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ end
344344
# TODO: should `error_style` be Makie plot types instead? I.e. `Band`, `Errorbar`, etc
345345
function Makie.convert_arguments(::Type{<:Lines},
346346
sim::SciMLBase.EnsembleSummary;
347-
trajectories = sim.u.u[1] isa AbstractArray ? eachindex(sim.u.u[1]) :
347+
idxs = sim.u.u[1] isa AbstractArray ? eachindex(sim.u.u[1]) :
348348
1,
349349
error_style = :ribbon, ci_type = :quantile,
350350
kwargs...)
@@ -384,7 +384,7 @@ function Makie.convert_arguments(::Type{<:Lines},
384384

385385
makie_plotlist = Makie.PlotSpec[]
386386

387-
for (count, idx) in enumerate(trajectories)
387+
for (count, idx) in enumerate(idxs)
388388
push!(makie_plotlist,
389389
S.Lines(sim.t, u[idx]; color = Makie.Cycled(count), label = "u[$idx]"))
390390
if error_style == :ribbon

src/ensemble/ensemble_solutions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ end
158158
end
159159

160160
@recipe function f(sim::EnsembleSummary;
161-
trajectories = sim.u.u[1] isa AbstractArray ? eachindex(sim.u.u[1]) :
161+
idxs = sim.u.u[1] isa AbstractArray ? eachindex(sim.u.u[1]) :
162162
1,
163163
error_style = :ribbon, ci_type = :quantile)
164164
if ci_type == :SEM
@@ -192,7 +192,7 @@ end
192192
else
193193
error("ci_type choice not valid. Must be `:SEM` or `:quantile`")
194194
end
195-
for i in trajectories
195+
for i in idxs
196196
@series begin
197197
legend --> false
198198
linewidth --> 3

0 commit comments

Comments
 (0)