# How to plot the solution of two different (but almost identical) differential equations on same plot?

**URL:** https://discourse.julialang.org/t/how-to-plot-the-solution-of-two-different-but-almost-identical-differential-equations-on-same-plot/34419
**Category:** New to Julia
**Tags:** plotting, diffeq
**Created:** [February 10, 2020, 2:58pm UTC](https://discourse.julialang.org/t/how-to-plot-the-solution-of-two-different-but-almost-identical-differential-equations-on-same-plot/34419 "2020-02-10T14:58:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![HelgavonLichtenstein](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/helgavonlichtenstein/32/5005_2.png) [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)
#### Post date: [February 10, 2020, 2:58pm UTC](https://discourse.julialang.org/t/how-to-plot-the-solution-of-two-different-but-almost-identical-differential-equations-on-same-plot/34419/1 "2020-02-10T14:58:11Z")

</div>

Hello,

I have two differential equations which calculate how much area a fleet of boats can cover. The two equations are nearly identical apart from how the area coverage is calculated. I would like to graph the outcomes of the two equations onto one plot.

I can plot them separately but cannot find in the [documentation](https://docs.juliadiffeq.org/v1.10.1/basics/plot.html) how to do it together.

The `p` changes between the two in that one of the parameters is a different function. All other parameters stay the same.

```julia
static_prob = ODEProblem(dBdT,bioS,tspan,p)
static = solve(static_prob)

boom_prob = ODEProblem(dBdT,bioS,tspan,p)
boom_sol = solve(boom_prob)

plot(static_sol, vars = ((num_nutrient+num_plant+num_animal+num_vessel_types)), tspan=(0.0,tmax), title = "Static - Vessel biomass $target_species", xlabel = "Time" ,ylabel = "Biomass", lw=0.3)
plot(boom_sol, vars = ((num_nutrient+num_plant+num_animal+num_vessel_types)), tspan=(0.0,tmax), title = "Boom-Bust - Vessel biomass $target_species", xlabel = "Time" ,ylabel = "Biomass", lw=0.3)

```

This produces

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/5/b5522d48a010ca94b4574c09d7ac865241efb452.png)

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/7/97248d1e7f6dcd5341251ca26647d28449ce30b9.png)

I would really like to have them on one plot!

Does anyone have suggestions?

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [February 10, 2020, 3:05pm UTC](https://discourse.julialang.org/t/how-to-plot-the-solution-of-two-different-but-almost-identical-differential-equations-on-same-plot/34419/2 "2020-02-10T15:05:48Z")

</div>

You’re looking for `plot!(...)` - note the `!`, which indicates that the command changes the current plot object rather than producing a new plot.

---

<div class="post-metadata">

### Author: ![HelgavonLichtenstein](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/helgavonlichtenstein/32/5005_2.png) [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)
#### Post date: [February 10, 2020, 3:23pm UTC](https://discourse.julialang.org/t/how-to-plot-the-solution-of-two-different-but-almost-identical-differential-equations-on-same-plot/34419/3 "2020-02-10T15:23:15Z")

</div>

Of course! Thanks 🙂

I feel very silly now.
