Skip to content

Commit 002136e

Browse files
Merge pull request #62 from lamorton/fix_plot_saveat
Fix plotting of solution when `saveat` is used
2 parents 443e151 + 192cfdf commit 002136e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/solutions/solution_interface.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ function diffeq_to_arrays(sol,plot_analytic,denseplot,plotdensity,tspan,axis_saf
344344
# Plot for sparse output: use the timeseries itself
345345
if sol.tslocation == 0
346346
plott = sol.t
347-
plot_timeseries = sol.u
347+
plot_timeseries = DiffEqArray(sol.t, sol.u)
348348
if plot_analytic
349349
plot_analytic_timeseries = sol.u_analytic
350350
else
@@ -357,7 +357,7 @@ function diffeq_to_arrays(sol,plot_analytic,denseplot,plotdensity,tspan,axis_saf
357357
plott = collect(densetspacer(tspan[1],tspan[2],plotdensity))
358358
end
359359

360-
plot_timeseries = sol.u[start_idx:end_idx]
360+
plot_timeseries = DiffEqArray(sol.t[start_idx:end_idx], sol.u[start_idx:end_idx])
361361
if plot_analytic
362362
plot_analytic_timeseries = sol.u_analytic[start_idx:end_idx]
363363
else

0 commit comments

Comments
 (0)