# MTK: scaling of variables in plot

**URL:** <https://discourse.julialang.org/t/mtk-scaling-of-variables-in-plot/94303>\
**Category:** Modelling & Simulations\
**Created:** [February 8, 2023, 9:11pm UTC](https://discourse.julialang.org/t/mtk-scaling-of-variables-in-plot/94303 "2023-02-08T21:11:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [February 8, 2023, 9:11pm UTC](https://discourse.julialang.org/t/mtk-scaling-of-variables-in-plot/94303/1 "2023-02-08T21:11:57Z")

</div>

Suppose the solution `sol` from simulating an MTK model contains state `x` and observable variable `y`.

I can then plot `x` with either of the following commands:

```julia
plot(sol, idxs = x)
# or
plot(sol, idxs = [x])

```

If I want to plot both `x` and `y` as functions of time `t`, I do

```julia
plot(sol, idxs = [x,y])

```

If I instead want a parametric plot, I do

```julia
plot(sol, idxs = (x,y))
# or
plot(sol, idxs = [(x,y)])

```

I can also plot the time function `x` as the “parametric plot”

```julia
plot(sol, idxs = (t,x))

```

If I want to _scale_ variables in time plots, I can do, e.g.,

```julia
plot(sol, idxs = [x/1e5, y*1e3])

```

- What if I want to scale both time and variable? I have tried with:

```julia
plot(sol, idxs = (t/60, x/1e5))

```

but this crashes.

- **Question** : What is the correct way to scale both variables in a parametric plot?

---

<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 8, 2023, 9:30pm UTC](https://discourse.julialang.org/t/mtk-scaling-of-variables-in-plot/94303/2 "2023-02-08T21:30:26Z")

</div>

> [@BLI](#):
>
> - **Question** : What is the correct way to scale both variables in a parametric plot?

Open an issue, we need to update the time handling stuff.

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [February 8, 2023, 9:32pm UTC](https://discourse.julialang.org/t/mtk-scaling-of-variables-in-plot/94303/3 "2023-02-08T21:32:41Z")

</div>

Ok. Will do tomorrow. [I thought I just didn’t know how to do it.]

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [February 28, 2023, 12:41pm UTC](https://discourse.julialang.org/t/mtk-scaling-of-variables-in-plot/94303/4 "2023-02-28T12:41:28Z")

</div>

Seems to have been fixed. Thanks a lot!
