7575 end
7676 else
7777 # Plot for sparse output: use the timeseries itself
78- if end_idx == 0
78+ if sol . tslocation == 0
7979 plott = sol. t
8080 plot_timeseries = sol. u
8181 if plot_analytic
9595 @assert length (var) == dims
9696 end
9797 # Should check that all have the same dims!
98- plot_vecs,labels = solplot_vecs_and_labels (dims,int_vars,plot_timeseries,plott,sol,plot_analytic,end_idx )
98+ plot_vecs,labels = solplot_vecs_and_labels (dims,int_vars,plot_timeseries,plott,sol,plot_analytic)
9999
100100 tdir = sign (sol. t[end ]- sol. t[1 ])
101101 xflip --> tdir < 0
@@ -237,20 +237,12 @@ function add_analytic_labels!(labels,x,dims,sol)
237237 end
238238end
239239
240- function u_n (timeseries:: AbstractArray , n:: Int ,sol,plott,plot_timeseries,end_idx )
240+ function u_n (timeseries:: AbstractArray , n:: Int ,sol,plott,plot_timeseries)
241241 # Returns the nth variable from the timeseries, t if n == 0
242242 if n == 0
243- if end_idx == 0
244- return plott
245- else
246- return plott[1 : end_idx]
247- end
243+ return plott
248244 elseif n == 1 && ! (typeof (sol[1 ]) <: AbstractArray )
249- if end_idx == 0
250- return timeseries
251- else
252- return timeseries[1 : end_idx]
253- end
245+ return timeseries
254246 else
255247 tmp = Vector {eltype(sol[1])} (length (plot_timeseries))
256248 for j in 1 : length (plot_timeseries)
@@ -260,23 +252,23 @@ function u_n(timeseries::AbstractArray, n::Int,sol,plott,plot_timeseries,end_idx
260252 end
261253end
262254
263- function solplot_vecs_and_labels (dims,vars,plot_timeseries,plott,sol,plot_analytic,end_idx )
255+ function solplot_vecs_and_labels (dims,vars,plot_timeseries,plott,sol,plot_analytic)
264256 plot_vecs = []
265257 for i in 1 : dims
266258 push! (plot_vecs,[])
267259 end
268260 labels = String[]# Array{String, 2}(1, length(vars)*(1+plot_analytic))
269261 for x in vars
270262 for j in 1 : dims
271- push! (plot_vecs[j], u_n (plot_timeseries, x[j],sol,plott,plot_timeseries,end_idx ))
263+ push! (plot_vecs[j], u_n (plot_timeseries, x[j],sol,plott,plot_timeseries))
272264 end
273265 add_labels! (labels,x,dims,sol)
274266 end
275267
276268 if plot_analytic
277269 for x in vars
278270 for j in 1 : dims
279- push! (plot_vecs[j], u_n (plot_timeseries, x[j],sol,plott,plot_timeseries,end_idx ))
271+ push! (plot_vecs[j], u_n (plot_timeseries, x[j],sol,plott,plot_timeseries))
280272 end
281273 add_analytic_labels! (labels,x,dims,sol)
282274 end
0 commit comments