Skip to content

Commit

Permalink
Update Makie plot recipe kwargs for EnsembleSummary
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
jonathanfischer97 authored May 28, 2024
1 parent bbdd876 commit 11560bc
Showing 1 changed file with 2 additions and 2 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

0 comments on commit 11560bc

Please sign in to comment.