{
"title": "mesh",
"category": "plotting",
"keywords": [
"mesh",
"wireframe plot",
"wireframe surface",
"matlab mesh",
"3-D grid visualization"
],
"summary": "Create wireframe surface plots for grids, height fields, and MATLAB `mesh` style visualization.",
"gpu_support": {
"elementwise": false,
"reduction": false,
"precisions": [
"single",
"double"
],
"broadcasting": "none",
"notes": "`mesh` reuses the shared surface pipeline with wireframe-oriented rendering semantics."
},
"fusion": {
"elementwise": false,
"reduction": false,
"max_inputs": 3,
"constants": "inline"
},
"requires_feature": null,
"tested": {
"unit": "builtins::plotting::mesh::tests"
},
"description": "`mesh` creates wireframe surface plots from vector axes or meshgrid-style coordinates plus a height grid. In RunMat it shares the same surface/object infrastructure as `surf`, but presents the data as a wireframe-style surface rather than a shaded filled surface, matching MATLAB `mesh` expectations.",
"behaviors": [
"`mesh(Z)` uses implicit axes, while `mesh(X, Y, Z)` accepts vector axes or meshgrid-style coordinate matrices.",
"The builtin returns a surface handle, so mesh plots can still be inspected through the graphics-object system.",
"`mesh` is the wireframe-oriented companion to `surf`; for combined wireframe plus contour overlays, use `meshc`.",
"RunMat uses the shared surface pipeline for mesh rendering, so view, z-axis labeling, and subplot-local state behave consistently across the surface family.",
"GPU-backed rendering is preferred when the plotting device can consume exported buffers directly."
],
"examples": [
{
"description": "Create a wireframe mesh from a height field",
"input": "[X, Y] = meshgrid(linspace(-2, 2, 60), linspace(-2, 2, 60));\nZ = sin(X.^2 + Y.^2);\nmesh(X, Y, Z);"
},
{
"description": "Compare wireframe presentation with subplot-local state",
"input": "subplot(1, 2, 1);\n[X, Y] = meshgrid(linspace(-2, 2, 40), linspace(-2, 2, 40));\nZ = cos(X) .* sin(Y);\nmesh(X, Y, Z);\nview(3);\nsubplot(1, 2, 2);\nsurf(X, Y, Z);\nview(3);"
},
{
"description": "Inspect the returned surface handle from mesh",
"input": "[X, Y] = meshgrid(1:20, 1:20);\nZ = X + Y;\nh = mesh(X, Y, Z);\nget(h, 'Type')",
"output": "ans =\n 'surface'"
}
],
"links": [
{ "label": "surf", "url": "./surf" },
{ "label": "meshc", "url": "./meshc" },
{ "label": "view", "url": "./view" },
{ "label": "zlabel", "url": "./zlabel" },
{ "label": "colormap", "url": "./colormap" }
],
"source": {
"label": "`crates/runmat-runtime/src/builtins/plotting/ops/mesh.rs`",
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/plotting/ops/mesh.rs"
}
}