# "Plot over line" the graph of analytical expression (as a function of x,t) over various time

**URL:** https://discourse.paraview.org/t/plot-over-line-the-graph-of-analytical-expression-as-a-function-of-x-t-over-various-time/3869
**Category:** ParaView Support
**Created:** [March 23, 2020, 10:55pm UTC](https://discourse.paraview.org/t/plot-over-line-the-graph-of-analytical-expression-as-a-function-of-x-t-over-various-time/3869 "2020-03-23T22:55:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![krishnakumar](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/aeb1de/32.png) [@krishnakumar](https://discourse.paraview.org/u/krishnakumar)
#### Post date: [March 23, 2020, 10:55pm UTC](https://discourse.paraview.org/t/plot-over-line-the-graph-of-analytical-expression-as-a-function-of-x-t-over-various-time/3869/1 "2020-03-23T22:55:34Z")

</div>

I have a function u(x,t) = 10\sin(\frac{\pi}{10} t)\left(x^3 - 10 x^2 + 25 x\right) i.e. a function of time ‘t’ and 1D space co-ordinate ‘x’.

A numerical approximation of this solution has been obtained by solving a PDE and has been written as .vtu files to disk. I have managed to visualize these numerical solutions by using the ‘plot over line’ filter. Attached first 10 time-step files.[solution-dopri-000.vtu](https://discourse.paraview.org/uploads/short-url/rMKFkA0On4jhPDBRbe1vr5xwlXf.vtu) (1.6 KB) [solution-dopri-010.vtu](https://discourse.paraview.org/uploads/short-url/rO3OM9mYKwJR4HYPUhCOUAvd2sV.vtu) (2.0 KB) [solution-dopri-020.vtu](https://discourse.paraview.org/uploads/short-url/tffxkENGZzZaZlJCne7c7Db3soY.vtu) (2.0 KB) [solution-dopri-030.vtu](https://discourse.paraview.org/uploads/short-url/8x3TWwIPcqv7wvykg4n6zaad5yY.vtu) (2.0 KB) [solution-dopri-040.vtu](https://discourse.paraview.org/uploads/short-url/bIIqoW3WtY9jsCATxZ3qFo59rVN.vtu) (2.0 KB) [solution-dopri-050.vtu](https://discourse.paraview.org/uploads/short-url/vzI9sxjzKBehZssXGWSNglR1fey.vtu) (2.0 KB) [solution-dopri-060.vtu](https://discourse.paraview.org/uploads/short-url/obDhPAPtPTWjcaxbAzENod4tPxM.vtu) (2.0 KB) [solution-dopri-070.vtu](https://discourse.paraview.org/uploads/short-url/yX1FFRr49TlP5Tyk9DUhBYupg8o.vtu) (2.0 KB) [solution-dopri-080.vtu](https://discourse.paraview.org/uploads/short-url/gYVsbMgr8EhIDd2LwUCmvvKzq65.vtu) (2.0 KB) [solution-dopri-090.vtu](https://discourse.paraview.org/uploads/short-url/3PUfBNZU6h4Hajuig69sSXbDVpR.vtu) (2.0 KB) [solution-dopri-100.vtu](https://discourse.paraview.org/uploads/short-url/m67SX5Q5GwrGJRblf8Y9rzWdvOh.vtu) (2.0 KB)

I now want to superimpose the spatial plot of the analytical equation for u(x,t) at each time-step. How can I do this in Paraview?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 24, 2020, 1:14am UTC](https://discourse.paraview.org/t/plot-over-line-the-graph-of-analytical-expression-as-a-function-of-x-t-over-various-time/3869/2 "2020-03-24T01:14:13Z")

</div>

Sounds like the filter “Python Calculator” should be able to compute this function.

---

<div class="post-metadata">

### Author: ![krishnakumar](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/aeb1de/32.png) [@krishnakumar](https://discourse.paraview.org/u/krishnakumar)
#### Post date: [March 24, 2020, 1:42am UTC](https://discourse.paraview.org/t/plot-over-line-the-graph-of-analytical-expression-as-a-function-of-x-t-over-various-time/3869/3 "2020-03-24T01:42:56Z")

</div>

@mwestphal can you elaborate just a bit more? I am fairly new to Paraview. I wish to plot over the 1D spatial domain, the numerical solution in red, the analytical solution in blue, and have them both evolve as I click the time-animation control buttons. Ideally, the numerical and analytical curves should lie on top of each other.

Why a filter? I don’t want to filter any existing data. I think you meant a ‘source’, right? However, the python calculator source is greyed out.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 24, 2020, 2:02am UTC](https://discourse.paraview.org/t/plot-over-line-the-graph-of-analytical-expression-as-a-function-of-x-t-over-various-time/3869/4 "2020-03-24T02:02:07Z")

</div>

- Open ParaView
- File -\> Open -\> solution-dopri-\* -\> Apply
- Filters -\> PlotData -\> Apply
- Use “Point X” as an X array.
- Change “solution” color to red -\> That’s your first curve
- Filters -\> Python Calculator
- Write your expression. `inputs[0].Points[:,0]` is your x, `time_value` is your t
- Apply
- Change result color to blue -\> That’s your second curve
