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

sgtitle — Set a centered figure-level title above all subplots with MATLAB-compatible sgtitle behavior.

sgtitle sets or updates a single figure-level title rendered above the full figure instead of a specific axes. It supports MATLAB-compatible current-figure and explicit-figure forms and returns a text handle for property updates.

Syntax

h = sgtitle(txt)
h = sgtitle(fig, txt)
h = sgtitle(txt, Name, Value, ...)
h = sgtitle(fig, txt, Name, Value, ...)

Inputs

NameTypeRequiredDefaultDescription
txtAnyYes—Super-title text (string/char/cellstr-like multiline forms; numeric scalars also accepted).
figNumericScalarYes—Target figure handle.
propsAnyVariadic—Property/value pairs (Color, FontSize, FontWeight, etc.).

Returns

NameTypeDescription
hNumericScalarHandle to the created/updated super-title object.

Errors

IdentifierWhenMessage
RunMat:sgtitle:InvalidArgumentFigure handle, text payload, or property/value arguments are invalid.sgtitle: invalid argument
RunMat:sgtitle:InternalInternal plotting state update fails.sgtitle: internal operation failed

How sgtitle works

  • The returned value is a text handle that can be inspected or updated through get and set.
  • Unlike title, sgtitle is figure-scoped and is drawn once above all subplot panels.
  • String scalars, char arrays, string arrays, and cell arrays can all be used to create multiline super titles.
  • Text styling properties such as FontSize, FontWeight, FontAngle, Color, Interpreter, and Visible use the shared plotting text-property system.
  • A scalar value from any integer class can be used as title text; RunMat formats the exact signed or unsigned value directly, including uint64 values above the exact double range. Integer FontSize values are accepted as numeric style controls.

Examples

Add a super title above a subplot figure

subplot(2, 2, 1);
plot(1:10, rand(1, 10));
subplot(2, 2, 2);
plot(1:10, rand(1, 10));
subplot(2, 2, 3);
plot(1:10, rand(1, 10));
subplot(2, 2, 4);
plot(1:10, rand(1, 10));
sgtitle('Experiment Summary');

Style the figure-level title and inspect the returned handle

subplot(1, 2, 1);
imagesc(peaks(20));
subplot(1, 2, 2);
imagesc(peaks(20));
h = sgtitle('Field Comparison', 'FontSize', 18, 'FontWeight', 'bold');
get(h, 'Type')

Expected output:

ans =
    'text'

Target an explicit figure handle

fig = figure(42);
subplot(1, 2, 1);
plot(0:0.1:1, sin(0:0.1:1));
subplot(1, 2, 2);
plot(0:0.1:1, cos(0:0.1:1));
sgtitle(fig, 'Sine and Cosine');

Using sgtitle with coding agents

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

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

FAQ

How is sgtitle different from title?⌄

title attaches text to the current axes, so each subplot can have its own panel title. sgtitle attaches text to the figure as a whole and is drawn once above all panels. Use title for per-panel labels and sgtitle for the overall figure heading.

Can I update the super title after creating it?⌄

Yes. sgtitle returns a text handle, so you can inspect or update it with get and set.

h = sgtitle('Initial Title');
set(h, 'String', 'Updated Title', 'FontWeight', 'bold');
What target objects are supported?⌄

Phase 1 supports the current figure by default and explicit figure handles through sgtitle(fig, txt, ...). Larger MATLAB target containers such as panels or tabs are tracked separately and are not part of the current implementation.

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 · 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 · fill · 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

More plotting resources

  • Styling plots and axes
  • Plot replay and export
  • Complete plotting guide

Open-source implementation

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

  • View the source for sgtitle 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 sgtitle works
  • Examples
  • Add a super title above a subplot figure
  • Style the figure-level title and inspect the returned handle
  • Target an explicit figure handle
  • Using sgtitle with coding agents
  • FAQ
  • Related Plotting functions
  • 2D Charts
  • 3D & Surface
  • Images
  • Axes & Layout
  • Appearance
  • Handle Access
  • Other
  • More plotting resources
  • Open-source implementation
  • About RunMat