# filter 'Plot over line' gives nan values

**URL:** https://discourse.paraview.org/t/filter-plot-over-line-gives-nan-values/11337
**Category:** ParaView Support
**Created:** [February 6, 2023, 1:18am UTC](https://discourse.paraview.org/t/filter-plot-over-line-gives-nan-values/11337 "2023-02-06T01:18:40Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Leo0806](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/53a042/32.png) [@Leo0806](https://discourse.paraview.org/u/Leo0806)
#### Post date: [February 6, 2023, 1:18am UTC](https://discourse.paraview.org/t/filter-plot-over-line-gives-nan-values/11337/1 "2023-02-06T01:18:40Z")

</div>

Hi

I am working with a 2d Tecplot file with a .plt extension. I want a graph of parameters like velocity along a line. So I used the function “plot over line”, but I got no chart in return. When I look at the spreadsheet view of “plot over line”, there are Nan values for all parameters. Can you help me with this?

Say, I would like to plot U\_Uj along a line with Point1 (0,0,0) and Point2 (25,0,0).

[https://drive.google.com/drive/folders/1TxcMiIFsTCZQ6yocl6dj66Khb3XpLvhe?usp=share\_link](https://drive.google.com/drive/folders/1TxcMiIFsTCZQ6yocl6dj66Khb3XpLvhe?usp=share_link)

Thank you

---

<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: [February 6, 2023, 11:56am UTC](https://discourse.paraview.org/t/filter-plot-over-line-gives-nan-values/11337/2 "2023-02-06T11:56:23Z")

</div>

Hi @Leo0806

Which version of ParaView are you using ? PlotOverLine on 2D data was recently fixed.

Best,

---

<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: [February 6, 2023, 3:18pm UTC](https://discourse.paraview.org/t/filter-plot-over-line-gives-nan-values/11337/3 "2023-02-06T15:18:34Z")

</div>

I took a look at your data, and it does not appear to be correct. Your data looks like it is supposed to define a volume; it has many of hexahedra. However, the Z component of the coordinates seem to be missing. The entire volume is squashed onto the x-y plane. Because all the hexahedra lie on a plane, they are degenerate and this is fouling up the intersection queries necessary for the `Plot Over Line` filter. Even if the intersection queries did work, the results could be problematic as at every point you have many flattened cells overlapping each other. Which one should the plotter choose?

The best solution would be to go back and check your data. It does not seem to be generated correctly. If having a volume flattened onto the x-y plane is really want you want (which makes little sense), you can get the `Plot Over Line` filter to work by running the `Extract Surface` filter. This will pull out some quadrilateral faces that will intersect with the line correctly.

---

<div class="post-metadata">

### Author: ![Leo0806](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/53a042/32.png) [@Leo0806](https://discourse.paraview.org/u/Leo0806)
#### Post date: [March 1, 2023, 1:21pm UTC](https://discourse.paraview.org/t/filter-plot-over-line-gives-nan-values/11337/4 "2023-03-01T13:21:20Z")

</div>

Sorry for the late reply!

I actually tried opening the Tecplot file in Tecplot 360. It worked well, showing the correct 3D volume mesh. However, when I open it in Paraview, it seems to be mistaken and shows the 2D volume mesh squashed onto the x-y plane.

Is this a problem with Paravire reading the Tecplot file? If yes, is it possible to fix it? Thank you!

---

<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: [March 1, 2023, 6:21pm UTC](https://discourse.paraview.org/t/filter-plot-over-line-gives-nan-values/11337/5 "2023-03-01T18:21:51Z")

</div>

Hmm. This could be a problem with the reader.

This Tecplot reader is one of those in the VisitBridge, which means that the reader comes from the VisIt developer team. I just tried loading your data in the most recent version of VisIt (3.3.2) and got the same behavior. So, if it is an issue with the reader, it would at best take a long time for the fix to make it to ParaView. (See for example [Issue with tecplot binary cell centered data.](https://discourse.paraview.org/t/issue-with-tecplot-binary-cell-centered-data/10428) for a different problem with the same reader.)

That said, I took another look at your data, and it appears that the coordinates are repeated in the `x_D`, `y_D` and `z_D` fields, and the `z_D` field is actually correct. So, you can use the `Calculator` filter to fix the coordinates. Turn on the `Coordinate Results` checkbox and set the expression to `coords + z_D*kHat`.

 ![Screen Shot 2023-03-01 at 11.17.55 AM](https://discourse.paraview.org/uploads/default/original/2X/1/1d2e3018557469ac5982964d5d4a7e60bc2651df.png)

After you fix the coordinates, you may need to change to 3D interaction in the view. Click the `2D` in the small toolbar over the render view to change it to `3D`.

Here is a state file that enacts this fix: [fixed-coordinates.pvsm](https://discourse.paraview.org/uploads/short-url/jjDhNu0Vo69ROxw08MNmtcZVJoS.pvsm) (299.5 KB)

---

<div class="post-metadata">

### Author: ![Leo0806](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/53a042/32.png) [@Leo0806](https://discourse.paraview.org/u/Leo0806)
#### Post date: [March 2, 2023, 2:35am UTC](https://discourse.paraview.org/t/filter-plot-over-line-gives-nan-values/11337/6 "2023-03-02T02:35:19Z")

</div>

Dear Kenneth,  
Thank you so much! This indeed solves the issue.

---

<div class="post-metadata">

### Author: ![Leo0806](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/53a042/32.png) [@Leo0806](https://discourse.paraview.org/u/Leo0806)
#### Post date: [March 3, 2023, 5:18pm UTC](https://discourse.paraview.org/t/filter-plot-over-line-gives-nan-values/11337/7 "2023-03-03T17:18:09Z")

</div>

Dear Kenneth,

I am very new to ParaView and not familiar with it. I am stuck with plotting on a plane. Say, I want to plot U\_Uj \* (d U\_Uj / d x) on a rectangle, z=0, 1\<x\<2, 1\<y\<2. How could I do it?

Thank you!

---

<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: [March 3, 2023, 8:38pm UTC](https://discourse.paraview.org/t/filter-plot-over-line-gives-nan-values/11337/8 "2023-03-03T20:38:48Z")

</div>

This is a new question (actually 2 new questions), and that is usually best asked on a whole new thread. But I’ll answer them here.

The first question is how to derive U\_Uj \* (d U\_Uj / d x), Your data has a `U_Uj` field. You can get the derivative in each direction by using the `Gradient` filter. You can then use the `Calculator` filter to multiple `U_Uj` with the x component of the gradient.

The second question is how to plot on a plane. You can do that in ParaView by using the `Slice` filter ![image](https://discourse.paraview.org/uploads/default/original/2X/d/d4717966a68d0bb5e2ef23728dbecc0bfe8fdf00.png). Click the `Z Normal` button and ensure the origin has the z component as 0 to slice along the z=0 plane.

That will give you the slice along the entire domain. You can zoom to the part you want, or you can use the `Clip` filter ![image](https://discourse.paraview.org/uploads/default/original/2X/1/1209cc747b9ef4510db949268b745a56714e3c96.png). Change the  
`Clip Type` to `Box`. Then change `Position` to 1, 1, -1 and `Length` to 2, 2, 2 to get the 1\<x\<2, 1\<y\<2, z=0 region. You probably also want to turn off `Show Box`.

Here is the state file I created with your data to do this: [plane-plot.pvsm](https://discourse.paraview.org/uploads/short-url/mEd6CFlq6WXHSmMHEk3gvcPFb33.pvsm) (853.6 KB)
