# Plot sol with time transformation

**URL:** <https://discourse.julialang.org/t/plot-sol-with-time-transformation/34696>\
**Category:** New to Julia\
**Tags:** diffeq\
**Created:** [February 16, 2020, 12:59am UTC](https://discourse.julialang.org/t/plot-sol-with-time-transformation/34696 "2020-02-16T00:59:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lecalvaire](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@Lecalvaire](https://discourse.julialang.org/u/Lecalvaire)\
**Post date:** [February 16, 2020, 12:59am UTC](https://discourse.julialang.org/t/plot-sol-with-time-transformation/34696/1 "2020-02-16T00:59:31Z")

</div>

I have the solution of a system stored in a variable `sol`, which behaves just like a continuous function.  
What I need in not just a basic `plot(sol, vars=[1 2 3...])` but a plot with the x-axis transformed, i.e. I want to plot \vec y(f(t)) and not \vec y(t). Simply writing ` function sol1(t); return sol(f(t)); end` leads to errors when using plot because `sol2` is not the same type as `sol`, I suppose. (It does work when y is 1-dimensional)  
What’s the trick to make it work ?  
Thanks !

`plot(sol1, vars=[1,2])`  
leads to  
`MethodError: no method matching Float64(::Array{Float64,1}) Closest candidates are: Float64(!Matched::Int8) at float.jl:60 Float64(!Matched::Int16) at float.jl:60 Float64(!Matched::Int32) at float.jl:60 ... `

---

<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:** [February 16, 2020, 5:04am UTC](https://discourse.julialang.org/t/plot-sol-with-time-transformation/34696/2 "2020-02-16T05:04:21Z")

</div>

This example shows how to add a transformation to the plot:

[https://docs.juliadiffeq.org/latest/basics/plot/#Example-1](https://docs.juliadiffeq.org/latest/basics/plot/#Example-1)
