File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,16 @@ function isdenseplot(sol)
201201 sol. interp isa SensitivityInterpolation)
202202end
203203
204+ """
205+ $(TYPEDSIGNATURES)
206+
207+ Given the first element in a timeseries solution, return an `AbstractArray` of
208+ indices that can be plotted as continuous variables. This is useful for systems
209+ that store auxiliary variables in the state vector which are not meant to be
210+ used for plotting.
211+ """
212+ plottable_indices (x:: AbstractArray ) = 1 : length (x)
213+
204214@recipe function f (sol:: AbstractTimeseriesSolution ;
205215 plot_analytic = false ,
206216 denseplot = isdenseplot (sol),
225235 throw (ArgumentError (" No analytic solution was found but `plot_analytic` was set to `true`." ))
226236 end
227237
228- idxs = idxs === nothing ? ( 1 : length ( sol. u[1 ]) ) : idxs
238+ idxs = idxs === nothing ? plottable_indices ( sol. u[1 ]) : idxs
229239 if ! (idxs isa Union{Tuple, AbstractArray})
230240 vars = interpret_vars ([idxs], sol)
231241 else
You can’t perform that action at this time.
0 commit comments