# Plotting differential equation solutions

**URL:** <https://discourse.julialang.org/t/plotting-differential-equation-solutions/32705>\
**Category:** Visualization\
**Created:** [December 26, 2019, 4:04am UTC](https://discourse.julialang.org/t/plotting-differential-equation-solutions/32705 "2019-12-26T04:04:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuxi.liu](https://avatars.discourse-cdn.com/v4/letter/y/839c29/32.png) [@yuxi.liu](https://discourse.julialang.org/u/yuxi.liu)\
**Post date:** [December 26, 2019, 4:05am UTC](https://discourse.julialang.org/t/plotting-differential-equation-solutions/32705/1 "2019-12-26T04:05:00Z")

</div>

The following code runs really slowly, because it redraws the graph every update, instead of incrementally. There must be some method for incremental diagramming, but I can’t find any.

There should be a way to plot this directly in the library, too. Maybe I should put this in a feature request?

```julia
using DifferentialEquations, ParameterizedFunctions
van! = @ode_def VanDerPol begin
  dy = μ*((1-x^2)*y - x)
  dx = 1*y
end μ

prob = ODEProblem(van!, [0.0,2.0], (0.0,6.3), p=1e2)
sol = solve(prob)
@gif for t in 0:0.01:5
    xys = reduce(hcat, sol.(0:0.01:t))
    xs = xys[1,:]
    ys = xys[2,:]
    plot(xs, ys)
    scatter!([(last(xs), last(ys))])
end

```

![van de Pol graph](https://global.discourse-cdn.com/julialang/original/3X/d/b/db3769eff0cf9b8b6a98bb1df5c9a3f21e6f7db3.gif)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [December 26, 2019, 12:29pm UTC](https://discourse.julialang.org/t/plotting-differential-equation-solutions/32705/2 "2019-12-26T12:29:21Z")

</div>

For faster animations you should try using Makie.jl, since indeed Plots.jl has to remake the whole plots. We do not have recipes with Makie.jl yet though.
