pie — Create pie charts for part-to-whole comparisons, exploded slices, and MATLAB pie workflows.
pie creates part-to-whole charts from numeric slice values. In RunMat it returns a pie handle, supports slice metadata and labels, and uses the shared plotting/replay/export stack so labels, explode state, and figure overlays stay consistent across interactive rendering and export paths.
How pie works in RunMat
- Slice values determine the relative angular extent of each wedge.
- Explode-style workflows and slice labels are part of the pie rendering path.
- The returned value is a pie-handle object participating in the same broader plotting handle model used across the plotting stack.
- Pie labels and overlay semantics survive replay/export because they are part of the shared event/scene path.
- Pie charts are especially useful as the part-to-whole complement to bar and histogram-style quantitative plots.
Examples
Create a basic pie chart
pie([2 3 5]);Create an exploded pie chart
values = [4 2 3 1];
explode = [1 0 1 0];
pie(values, explode);Use labels for slice names
values = [5 3 2];
labels = {'compute', 'io', 'render'};
pie(values, labels);Related functions to explore
These functions work well alongside pie. Each page has runnable examples you can try in the browser.
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how pie works, line by line, in Rust.
- View pie.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.