contourf — Render MATLAB-compatible filled contour plots.
contourf(X, Y, Z) fills the regions between contour levels with solid colors. When the axes are omitted, RunMat assumes 1:m and 1:n just like MATLAB. The default level count matches MATLAB's behaviour (10).
How contourf runs on the GPU
Single/double-precision gpuArrays feed a compute shader that emits renderer-ready triangles on the shared WebGPU device.
When GPU support is unavailable, tensors gather to host memory and rendering proceeds on the CPU path with identical results.
Related functions to explore
These functions work well alongside contourf. Each page has runnable examples you can try in the browser.
bar, contour, hist, mesh, meshc, plot, scatter, scatter3, stairs, surf, surfc
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how contourf works, line by line, in Rust.
- View contourf.rs on GitHub
- Learn how the runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is an open-source runtime that executes MATLAB-syntax code — faster, on any GPU, with no license required.
- Simulations that took hours now take minutes. RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed.
- Start running code in seconds. Open the browser sandbox or download a single binary. No license server, no IT ticket, no setup.
- A full development environment. GPU-accelerated 2D and 3D plotting, automatic versioning on every save, and a browser IDE you can share with a link.