# Isolate single species when plotting ensemble problem

**URL:** <https://discourse.julialang.org/t/isolate-single-species-when-plotting-ensemble-problem/92784>\
**Category:** Visualization\
**Tags:** question\
**Created:** [January 11, 2023, 2:04am UTC](https://discourse.julialang.org/t/isolate-single-species-when-plotting-ensemble-problem/92784 "2023-01-11T02:04:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dragolonth](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@Dragolonth](https://discourse.julialang.org/u/Dragolonth)\
**Post date:** [January 11, 2023, 2:04am UTC](https://discourse.julialang.org/t/isolate-single-species-when-plotting-ensemble-problem/92784/1 "2023-01-11T02:04:35Z")

</div>

Hi everyone. I’ve created an ensemble problem for a reaction network with many species. However, currently, the plot shows each trajectory for each species. For example, my reaction network has 19 species, so when I specify two trajectories in the ensemble problem, I see 38 trajectories on the plot. Is there a way that I can isolate the trajectories for a specific species on the plot? Thanks!

---

<div class="post-metadata">

**Author:** ![isaacsas](https://avatars.discourse-cdn.com/v4/letter/i/f6c823/32.png) [@isaacsas](https://discourse.julialang.org/u/isaacsas)\
**Post date:** [January 11, 2023, 1:34pm UTC](https://discourse.julialang.org/t/isolate-single-species-when-plotting-ensemble-problem/92784/2 "2023-01-11T13:34:49Z")

</div>

Can you provide a MWE of your code we can run? It will be easier to show how to plot components from that.

---

<div class="post-metadata">

**Author:** ![skleinbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skleinbo/32/36080_2.png) [@skleinbo](https://discourse.julialang.org/u/skleinbo)\
**Post date:** [January 11, 2023, 2:26pm UTC](https://discourse.julialang.org/t/isolate-single-species-when-plotting-ensemble-problem/92784/3 "2023-01-11T14:26:13Z")

</div>

Difficult to answer without knowing which packages you are using. If it’s `DifferentialEquations.jl` or related, in conjunction with `Plots.jl`, then you may find the solution here [Plot Functions · DifferentialEquations.jl](https://docs.sciml.ai/DiffEqDocs/stable/basics/plot/#plot_vars)

---

<div class="post-metadata">

**Author:** ![isaacsas](https://avatars.discourse-cdn.com/v4/letter/i/f6c823/32.png) [@isaacsas](https://discourse.julialang.org/u/isaacsas)\
**Post date:** [January 11, 2023, 2:57pm UTC](https://discourse.julialang.org/t/isolate-single-species-when-plotting-ensemble-problem/92784/4 "2023-01-11T14:57:39Z")

</div>

Here’s an example if you are using Catalyst:

```julia
using Catalyst, DifferentialEquations, Plots
rn = @reaction_network begin
       1.0, A --> 0
       2.0, B --> 0
       4.0, C --> 0
       end
dprob = DiscreteProblem(rn, [:A => 100, :B => 10, :C => 5], (0.0,20.0))
jprob = JumpProblem(rn, dprob, Direct())
eprob = EnsembleProblem(jprob)
sims = solve(eprob, SSAStepper(), trajectories=100)
@unpack C = rn
plot(sims, idxs=C)

```
