# Choosing variables to plot from DifferentialEquations solution

**URL:** <https://discourse.julialang.org/t/choosing-variables-to-plot-from-differentialequations-solution/38252>\
**Category:** General Usage\
**Created:** [April 26, 2020, 6:21pm UTC](https://discourse.julialang.org/t/choosing-variables-to-plot-from-differentialequations-solution/38252 "2020-04-26T18:21:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eris/32/8438_2.png) [@Eris](https://discourse.julialang.org/u/Eris)\
**Post date:** [April 26, 2020, 6:21pm UTC](https://discourse.julialang.org/t/choosing-variables-to-plot-from-differentialequations-solution/38252/1 "2020-04-26T18:21:29Z")

</div>

I understand that vrs is used in order to choose the variables to be plotted. i.e. in this example I plotted x vs y

> using DifferentialEquations, ParameterizedFunctions, Plots  
> attrac = @ode\_def begin  
> dx = σ_y  
> dy = ρ_(y-x)  
> end σ ρ  
> u0 = [0.0,1.0]  
> tspan = (0.0,10)  
> p = [sqrt(12π),1.0]  
> prob = ODEProblem(attrac, u0, tspan, p)  
> sol = solve(prob,alg=Trapezoid())  
> plot(sol,vars=(1,2))

Where one uses vars=(var1, var2) where 0, 1, 2 stand for time, x, y, respectively. Now I’d like to define a function out of these variables and plot it. For example plot z(t)=y\*x
