{
"title": "contourf",
"category": "plotting",
"keywords": [
"contourf",
"filled contour plot",
"level regions",
"scalar field heatmap",
"matlab contourf"
],
"summary": "Create filled contour plots for level regions, scalar fields, and MATLAB `contourf` workflows.",
"gpu_support": {
"elementwise": false,
"reduction": false,
"precisions": [
"single",
"double"
],
"broadcasting": "none",
"notes": "`contourf` uses the shared filled-contour pipeline and returns a contour-fill handle."
},
"fusion": {
"elementwise": false,
"reduction": false,
"max_inputs": 3,
"constants": "inline"
},
"requires_feature": null,
"tested": {
"unit": "builtins::plotting::contourf::tests"
},
"description": "`contourf` creates filled contour plots by coloring the regions between contour levels. In RunMat it returns a contour-fill handle, shares the contour level-generation path with `contour`, and acts as the filled-region counterpart to line-oriented contour plots.",
"behaviors": [
"`contourf(Z)` uses implicit axes, while `contourf(X, Y, Z)` accepts explicit coordinates.",
"The returned value is a contour-fill handle in the plotting object system.",
"Level-list, level-count, and related contour workflows mirror the broader contour family semantics.",
"`contourf` works naturally with `colorbar` and `colormap` because filled regions are fundamentally color-mapped scalar ranges.",
"Filled contours and optional line overlays are handled through the shared contour stack."
],
"examples": [
{
"description": "Create a filled contour plot",
"input": "[X, Y] = meshgrid(-2:0.25:2, -2:0.25:2);\nZ = X .* exp(-X.^2 - Y.^2);\ncontourf(X, Y, Z);\ncolorbar;"
},
{
"description": "Use explicit levels with a colormap",
"input": "[X, Y] = meshgrid(-3:0.2:3, -3:0.2:3);\nZ = cos(X) .* sin(Y);\ncontourf(X, Y, Z, [-0.75 -0.25 0 0.25 0.75]);\ncolormap('turbo');"
},
{
"description": "Inspect the returned contour-fill handle",
"input": "[X, Y] = meshgrid(1:20, 1:20);\nZ = X - Y;\nh = contourf(X, Y, Z);\nget(h, 'Type')",
"output": "ans =\n 'contour'"
}
],
"links": [
{ "label": "contour", "url": "./contour" },
{ "label": "colorbar", "url": "./colorbar" },
{ "label": "colormap", "url": "./colormap" },
{ "label": "surfc", "url": "./surfc" },
{ "label": "meshc", "url": "./meshc" }
],
"source": {
"label": "`crates/runmat-runtime/src/builtins/plotting/ops/contourf.rs`",
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/plotting/ops/contourf.rs"
}
}