# finding and outputting max point for plot over line

**URL:** https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417
**Category:** ParaView Support
**Created:** [September 24, 2020, 1:25am UTC](https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417 "2020-09-24T01:25:12Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [September 24, 2020, 1:25am UTC](https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417/1 "2020-09-24T01:25:12Z")

</div>

I have a user that needs to run dozens of plot over lines through his dataset, find the maximum value, and write this value out. This needs to occur in parallel.

Here is an example:

- Remote paraview. Further, this example needs to be traceable, and able to run on pvbatch in parallel.
- Sources/ wavelet. Apply.
- Plot over line. Apply.
- Now, I need to find the maximum and put it somewhere.
- Plot over line. Move the line slightly. Apply.
- Now, I need to find the maximum and put it somewhere.
- Gather these all together, and write the data out to a .csv file.

Thanks,

Alan

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [September 24, 2020, 1:26am UTC](https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417/2 "2020-09-24T01:26:01Z")

</div>

@utkarsh.ayachit @Kenneth_Moreland @cory.quammen

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [September 25, 2020, 7:31pm UTC](https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417/3 "2020-09-25T19:31:37Z")

</div>

This is a partial solution. You can use animation tracks to move the endpoints of the `Plot Over Line` filter. That would allow you to automate moving the line.

Normally, I would say the next step is to use the `Plot Data Over Time` filter to extract the max (along with the min, mean, and median) over all the timesteps. Unfortunately, that doesn’t work because `Plot Data Over Time` insists on using the timesteps from its source, not from the animation view. And the source does not actually have any timesteps. You should be able to add time steps using the `Programmable Filter`. I’ll let someone else figure that one out.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [September 25, 2020, 9:07pm UTC](https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417/4 "2020-09-25T21:07:19Z")

</div>

this can be converted to a Python script, but first, can you explain what “moving the line slightly” means? Is it a thing that has to be manual or is there an algorithm for it?

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [March 9, 2021, 6:19pm UTC](https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417/5 "2021-03-09T18:19:24Z")

</div>

I’m seeing this issue once again. I think I confused the question above (move the line slightly). Let me ask this:  
If I run a plot over line filter, I return something that can be plotted on a 2d lineplot. I want to find the maximum value of the output of the plot over line filter, and possibly length down the line.

@cory.quammen @utkarsh.ayachit@Kenneth_Moreland

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [March 10, 2021, 12:15am UTC](https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417/6 "2021-03-10T00:15:23Z")

</div>

Here are things I tried:

1. **Wavelet \> Plot Over Line \> Descriptive Statistics**
2. **Wavelet \> Plot Over Line \> Python Calculator** (expression: `max(RTData)`)

Both give max. In 1, it’s available as a single value in the output table. In 2, it’s added as the “result” array for all input points.

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [March 10, 2021, 9:22pm UTC](https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417/7 "2021-03-10T21:22:39Z")

</div>

Excellent. Thanks.

The plot over line filter can give gaps, which are filled in with nan’s. Nans are failing with either Desriptive Statistics or the python calculator… Any ideas? Maybe modify the Descriptive Statistics filter to optionally ignore nans (default on)?

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [March 10, 2021, 9:26pm UTC](https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417/8 "2021-03-10T21:26:35Z")

</div>

By the way, the way I am creating these gaps is as follows:

- load disk\_out\_ref.exo. All vars on. Apply.
- plot over line filter. Apply.
- Descriptive statistics. Apply.  
Now, I want the max of Temp.

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [March 12, 2021, 2:51am UTC](https://discourse.paraview.org/t/finding-and-outputting-max-point-for-plot-over-line/5417/9 "2021-03-12T02:51:40Z")

</div>

Thanks. I put all of the parts together, and wrote up a Tricks here: [How to find the maximum value on a line](https://discourse.paraview.org/t/how-to-find-the-maximum-value-on-a-line/6680). As always, feel free to edit it if I was not clear or made errors.
