MeshFunctions
is an option for plotting functions that specifies functions to use to determine the placement of mesh divisions.
Details

- In Plot3D, the default setting MeshFunctions->{#1&,#2&} specifies that meshes corresponding to x and y coordinates should be constructed.
- With the setting MeshFunctions->{m1,m2,…}, each function mi defines a family of mesh divisions.
- By default, the mesh divisions are taken to lie at positions giving equally spaced values of mi[…].
- The arguments supplied to the mi and the default MeshFunctions settings are as follows:
-
Plot and ListLinePlot x, y {#1&} ParametricPlot x, y, u or x, y, u, v {#3&} or {#3&,#4&} PolarPlot and ListPolarPlot x, y, θ, r (#3&) RegionPlot x, y {#1&,#2&} ContourPlot and ListContourPlot x, y, f {} DensityPlot and ListDensityPlot x, y, f {#1&,#2&} ContourPlot3D and ListContourPlot3D x, y, z, f {#1&,#2&,#3&} Plot3D and ListPlot3D x, y, z {#1&,#2&} ListSurfacePlot3D x, y, z {#1&,#2&,#3&} ParametricPlot3D x, y, z, u or x, y, z, u, v {#4&} or {#4&,#5&} RegionPlot3D x, y, z {#1&,#2&,#3&} - Each mi effectively defines a foliation.
- The mi should normally be chosen to be continuous monotonic functions.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Applications (1)Sample problems that can be solved with this function

https://wolfram.com/xid/0tzmru6b-b9pxcj
Use MeshFunctions to find the intercepts:

https://wolfram.com/xid/0tzmru6b-k1esxs

Use MeshFunctions to find the intersections between two functions:

https://wolfram.com/xid/0tzmru6b-bw8e9l

Neat Examples (2)Surprising or curious use cases
A case where Fubini's theorem does not hold [more info]:

https://wolfram.com/xid/0tzmru6b-d8tl

Real and imaginary parts as mesh functions:

https://wolfram.com/xid/0tzmru6b-z5brn

https://wolfram.com/xid/0tzmru6b-i34ds

https://wolfram.com/xid/0tzmru6b-jubzfm

Wolfram Research (2007), MeshFunctions, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshFunctions.html.
Text
Wolfram Research (2007), MeshFunctions, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshFunctions.html.
Wolfram Research (2007), MeshFunctions, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshFunctions.html.
CMS
Wolfram Language. 2007. "MeshFunctions." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MeshFunctions.html.
Wolfram Language. 2007. "MeshFunctions." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MeshFunctions.html.
APA
Wolfram Language. (2007). MeshFunctions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeshFunctions.html
Wolfram Language. (2007). MeshFunctions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeshFunctions.html
BibTeX
@misc{reference.wolfram_2025_meshfunctions, author="Wolfram Research", title="{MeshFunctions}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/MeshFunctions.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_meshfunctions, organization={Wolfram Research}, title={MeshFunctions}, year={2007}, url={https://reference.wolfram.com/language/ref/MeshFunctions.html}, note=[Accessed: 29-March-2025
]}