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)
201
201
sol. interp isa SensitivityInterpolation)
202
202
end
203
203
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
+
204
214
@recipe function f (sol:: AbstractTimeseriesSolution ;
205
215
plot_analytic = false ,
206
216
denseplot = isdenseplot (sol),
225
235
throw (ArgumentError (" No analytic solution was found but `plot_analytic` was set to `true`." ))
226
236
end
227
237
228
- idxs = idxs === nothing ? ( 1 : length ( sol. u[1 ]) ) : idxs
238
+ idxs = idxs === nothing ? plottable_indices ( sol. u[1 ]) : idxs
229
239
if ! (idxs isa Union{Tuple, AbstractArray})
230
240
vars = interpret_vars ([idxs], sol)
231
241
else
You can’t perform that action at this time.
0 commit comments