# Plot Over Line¶

Plot the values of a dataset over a line through that dataset

```# sphinx_gallery_thumbnail_number = 2
import pyvista as pv
from pyvista import examples
```

## Volumetric Mesh¶

First a 3D mesh example to demonstrate

```mesh = examples.download_kitchen()

# Make two points to construct the line between
a = [mesh.bounds, mesh.bounds, mesh.bounds]
b = [mesh.bounds, mesh.bounds, mesh.bounds]

# Preview how this line intersects this mesh
line = pv.Line(a, b)

p = pv.Plotter()
p.show()
``` Out:

```[(13.478563426690005, 12.478563426690005, 11.228563426690005),
(3.50499999942258, 2.50499999942258, 1.25499999942258),
(0.0, 0.0, 1.0)]
```

Run the filter and produce a line plot

```mesh.plot_over_line(a, b, resolution=100)
``` ## Flat Surface¶

We could also plot the values of a mesh that lies on a flat surface

```mesh = examples.download_st_helens()

# Make two points to construct the line between
a = [mesh.center, mesh.bounds, mesh.bounds]
b = [mesh.center, mesh.bounds, mesh.bounds]

# Preview how this line intersects this mesh
line = pv.Line(a, b)

p = pv.Plotter()
[a, b], ["A", "B"], font_size=48, point_color="red", text_color="red"
)
p.show()
``` Out:

```[(581864.4350162606, 5134010.9350162605, 19711.435016260606),
(562835.0, 5114981.5, 682.0),
(0.0, 0.0, 1.0)]
```

Run the filter and produce a line plot

```mesh.plot_over_line(
a,
b,
resolution=10000,
title="Elevation Profile",
ylabel="Height above sea level",
figsize=(10, 5),
)
``` Total running time of the script: ( 0 minutes 4.584 seconds)

Gallery generated by Sphinx-Gallery