# Plotting only certain trajectories of ensemble solution

**URL:** <https://discourse.julialang.org/t/plotting-only-certain-trajectories-of-ensemble-solution/93288>\
**Category:** Modelling & Simulations\
**Tags:** diffeq, plots, monte-carlo\
**Created:** [January 20, 2023, 11:00pm UTC](https://discourse.julialang.org/t/plotting-only-certain-trajectories-of-ensemble-solution/93288 "2023-01-20T23:00:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [January 20, 2023, 11:00pm UTC](https://discourse.julialang.org/t/plotting-only-certain-trajectories-of-ensemble-solution/93288/1 "2023-01-20T23:00:22Z")

</div>

If I soleve an ensemble problem:

```julia
using DifferentialEquations
using Plots

prob = ODEProblem((u,p,t)->1.01u,0.5,(0.0,1.0))

function prob_func(prob,i,repeat)
  remake(prob,u0=rand()*prob.u0)
end

ensemble_prob = EnsembleProblem(prob,prob_func=prob_func)
sim = solve(ensemble_prob,Tsit5(),EnsembleDistributed(),trajectories=10)

plot(sim,linealpha=0.4)

```

I will plot 10 trajectories. How do I do if I only want to plot the first, or every second, trajectory? I belive it used to be `idxs=1`, but that is now used to designate which variable you want to plot.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 20, 2023, 11:56pm UTC](https://discourse.julialang.org/t/plotting-only-certain-trajectories-of-ensemble-solution/93288/2 "2023-01-20T23:56:48Z")

</div>

Just poking around:

```julia
plot(sim.u[1], linealpha=0.4)
plot(sim.u[1:2:end], linealpha=0.4)

```
