<jupyter_start><jupyter_text>Plot Over Line {plot_over_line_example}==============Plot the values of a dataset over a line through that dataset<jupyter_code># sphinx_gallery_thumbnail_number = 2
import pyvista as pv
from pyvista import examples<jupyter_output><empty_output><jupyter_text>Volumetric Mesh===============First a 3D mesh example to demonstrate<jupyter_code>mesh = examples.download_kitchen()

# Make two points to construct the line between
a = [mesh.bounds[0], mesh.bounds[2], mesh.bounds[4]]
b = [mesh.bounds[1], mesh.bounds[3], mesh.bounds[5]]

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

p = pv.Plotter()
p.add_mesh(mesh, style="wireframe", color="w")
p.add_mesh(line, color="b")
p.show()<jupyter_output><empty_output><jupyter_text>Run the filter and produce a line plot<jupyter_code>mesh.plot_over_line(a, b, resolution=100)<jupyter_output><empty_output><jupyter_text>Flat Surface============We could also plot the values of a mesh that lies on a flat surface<jupyter_code>mesh = examples.download_st_helens()

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

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

p = pv.Plotter()
p.add_mesh(mesh)
p.add_mesh(line, color="white", line_width=10)
p.add_point_labels(
    [a, b], ["A", "B"], font_size=48, point_color="red", text_color="red"
)
p.show()<jupyter_output><empty_output><jupyter_text>Run the filter and produce a line plot<jupyter_code>mesh.plot_over_line(
    a,
    b,
    resolution=10000,
    title="Elevation Profile",
    ylabel="Height above sea level",
    figsize=(10, 5),
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14953810623556582, 'fraction_numerical': 0.01674364896073903, 'mean_word_length': 6.567685589519651, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '53350', 'license': 'MIT', 'n_tokens_mistral': 645, 'n_tokens_neox': 617, 'n_words': 152, 'path': 'locale/examples/02-plot/plot-over-line.ipynb', 'repo_name': 'tkoyama010/pyvista-doc-translations', 'size': '1732'}