RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact
  • License
  • Privacy

Learn

  • Docs
  • Blog
  • Benchmarks
  • RunMat vs MATLAB Online

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • addpoints
    • ancestor
    • animatedline
    • area
    • axes
    • axis
    • bar
    • barh
    • box
    • caxis
    • cla
    • clf
    • clim
    • colorbar
    • colorcube
    • colormap
    • colororder
    • contour
    • contour3
    • contourf
    • copyobj
    • daspect
    • datacursormode
    • dataTipTextRow
    • errorbar
    • fcontour
    • figure
    • fill
    • fill3
    • findobj
    • fsurf
    • gca
    • gcf
    • get
    • gobjects
    • grid
    • groot
    • heatmap
    • hgload
    • hgsave
    • hidden
    • hist
    • histogram
    • histogram2
    • hold
    • image
    • imagesc
    • imshow
    • legend
    • line
    • linkaxes
    • loglog
    • mesh
    • meshc
    • openfig
    • opengl
    • pan
    • parula
    • patch
    • pie
    • plot
    • plot3
    • plotmatrix
    • plotyy
    • polarhistogram
    • polarplot
    • polarscatter
    • print
    • quiver
    • quiver3
    • ribbon
    • saveas
    • savefig
    • scatter
    • scatter3
    • semilogx
    • semilogy
    • set
    • sgtitle
    • shading
    • sphere
    • stackedplot
    • stairs
    • stem
    • subplot
    • subtitle
    • suptitle
    • surf
    • surfc
    • text
    • textscatter
    • textscatter3
    • title
    • triplot
    • view
    • waitbar
    • wordcloud
    • xlabel
    • xlim
    • xline
    • xscale
    • xtickangle
    • xtickformat
    • xticklabels
    • xticks
    • ylabel
    • ylim
    • yline
    • yscale
    • ytickangle
    • ytickformat
    • yticklabels
    • yticks
    • zlabel
    • zlim
    • zoom

fill — Create filled 2-D polygon patches.

fill(X,Y,C) creates filled polygonal regions as Patch graphics. Integer coordinate and CData classes remain authoritative on the Patch object; conversion to renderer geometry is an explicit client-side boundary.

Syntax

p = fill(X, Y, C, ..., Name, Value)

Inputs

NameTypeRequiredDefaultDescription
argumentsAnyVariadic—One or more X,Y,C groups followed by Patch name/value properties.

Returns

NameTypeDescription
pAnyPatch handle or row vector of patch handles.

Errors

IdentifierWhenMessage
RunMat:fill:InvalidArgumentCoordinate/color groups, axes targeting, or properties are invalid.fill: invalid argument

How fill works

  • Equal-length row or column vector X and Y inputs create one region regardless of orientation; matrix inputs create independently addressable regions from columns.
  • When either coordinate is a matrix, an equal-length coordinate vector matching the matrix row count is shared across every matrix column; square matrices are grouped by columns.
  • Multiple X,Y,C groups create multiple Patch graphics.
  • C accepts color text, RGB triples, or numeric indexed color data.
  • XData, YData, and CData preserve the original numeric class and shape.
  • A leading axes handle targets an existing axes; typed-integer numeric aliases are available only when RunMat extensions are enabled.

Examples

Create a filled triangle

h = fill([0 1 0], [0 0 1], 'red');

Expected output:

h is a Patch graphics handle

Use exact integer coordinates and indexed color data

h = fill(uint64([0 1 0]), uint64([0 0 1]), uint8(1));

Expected output:

get(h,'XData') retains class uint64

Create one independently addressable Patch per matrix column

X = uint64([0 2; 1 3; 0 2]);
Y = uint64([0 0; 0 0; 1 1]);
C = uint16([1 4; 2 5; 3 6]);
h = fill(X,Y,C);

Expected output:

h is a two-element Patch handle vector; each handle retains its column's typed XData, YData, and CData

Using fill with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how fill changes the result.

Run a small fill example, explain the result, then change one input and compare the output.

FAQ

Is fill an array-construction function?⌄

No. MATLAB-compatible fill creates Patch graphics. Use createArray to construct constant-valued arrays.

Related Plotting functions

2D Charts

area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem

3D & Surface

contour · contour3 · contourf · mesh · meshc · plot3 · quiver · scatter3 · surf · surfc

Images

image · imagesc · imshow

Axes & Layout

axis · box · grid · sgtitle · subplot · title · view · zlabel

Appearance

colorbar · colormap · legend · shading

Handle Access

gca · gcf · get · set

Other

addpoints · ancestor · animatedline · axes · barh · caxis · cla · clf · clim · colorcube · colororder · copyobj · daspect · datacursormode · dataTipTextRow · fcontour · figure · fill3 · findobj · fsurf · gobjects · groot · hgload · hgsave · hidden · histogram2 · hold · line · linkaxes · openfig · opengl · pan · parula · patch · plotmatrix · plotyy · polarhistogram · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · stackedplot · subtitle · suptitle · text · textscatter · textscatter3 · triplot · waitbar · wordcloud · xlabel · xlim · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · ylabel · ylim · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zlim · zoom

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how fill is executed, line by line, in Rust.

  • View the source for fill in Rust on GitHub
  • Learn how the RunMat 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 blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How fill works
  • Examples
  • Create a filled triangle
  • Use exact integer coordinates and indexed color data
  • Create one independently addressable Patch per matrix column
  • Using fill with coding agents
  • FAQ
  • Related Plotting functions
  • 2D Charts
  • 3D & Surface
  • Images
  • Axes & Layout
  • Appearance
  • Handle Access
  • Other
  • Open-source implementation
  • About RunMat