suptitle — Set a centered figure-level title using the legacy suptitle alias for sgtitle.
suptitle sets the same figure-level title as sgtitle and exists primarily for compatibility with older MATLAB subplot code. It supports current-figure and explicit-figure forms and returns a text handle.
Syntax
h = suptitle(txt)
h = suptitle(fig, txt)
h = suptitle(txt, Name, Value, ...)
h = suptitle(fig, txt, Name, Value, ...)
suptitle(txt)
suptitle(fig, txt)
suptitle(txt, Name, Value, ...)
suptitle(fig, txt, Name, Value, ...)Inputs
txt- Type
Any- Required
- Yes
- Description
- Super-title text (string/char/cellstr-like multiline forms; numeric scalars also accepted).
fig- Type
NumericScalar- Required
- Yes
- Description
- Target figure handle.
props- Type
Any- Required
- Variadic
- Description
- Property/value pairs (Color, FontSize, FontWeight, etc.).
Returns
h- Type
NumericScalar- Description
- Handle to the created/updated super-title object.
Errors
RunMat:suptitle:InvalidArgument- When
- Figure handle, text payload, or property/value arguments are invalid.
- Message
suptitle: invalid argument
RunMat:suptitle:Internal- When
- Internal plotting state update fails.
- Message
suptitle: internal operation failed
RunMat:suptitle:TooManyOutputs- When
- More than one output is requested.
- Message
suptitle: too many output arguments
Behavior
suptitle(txt) updates the current figure and returns the super-title text handle.
suptitle(fig, txt, ...) targets an explicit figure handle when the handle exists.
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.
suptitle and sgtitle update the same figure-level title object.
Placement and execution
This command mutates local graphics scene state and may notify the graphics host. Inputs and returned graphics handles are host-owned; worker transfer of numeric handle values does not transfer scene ownership.
Interpreter and compiled routes use the same runtime operation; a browser graphics host or desktop graphics host is required for presentation.
Examples
Add a super title above a subplot figure
subplot(2, 1, 1);
plot(1:10, rand(1, 10));
subplot(2, 1, 2);
plot(1:10, rand(1, 10));
suptitle('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 = suptitle('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));
suptitle(fig, 'Sine and Cosine');Using suptitle with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how suptitle changes the result.
Run a small suptitle example, explain the result, then change one input and compare the output.
FAQ
How is suptitle different from sgtitle?⌄
In RunMat, suptitle and sgtitle update the same figure-level super title. suptitle is provided as a compatibility spelling for MATLAB code that uses the older helper name.
How is suptitle different from title?⌄
title attaches text to the current axes, so each subplot can have its own panel title. suptitle attaches text to the figure as a whole and is drawn once above all panels.
Can I update the super title after creating it?⌄
Yes. suptitle returns a text handle, so you can inspect or update it with get and set.
h = suptitle('Initial Title');
set(h, 'String', 'Updated Title', 'FontWeight', 'bold');Related Plotting functions
2D Charts
area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem
Other
addpoints · ancestor · animatedline · autumn · axes · barh · bone · caxis · cla · clf · clim · colorcube · colororder · cool · copper · copyobj · cylinder · daspect · datacursormode · dataTipTextRow · drawnow · fcontour · figure · fill · fill3 · findobj · fsurf · gobjects · gray · groot · hgload · hgsave · hidden · histogram2 · hold · hot · inferno · isgraphics · ishandle · jet · line · lines · linkaxes · magma · openfig · opengl · pan · parula · patch · pink · plasma · plotmatrix · plotyy · polarhistogram · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · spring · stackedplot · subtitle · summer · text · textscatter · textscatter3 · triplot · turbo · viridis · waitbar · winter · wordcloud · xlabel · xlim · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · ylabel · ylim · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zlim · zoom
More plotting resources
Source you can read
Every RunMat function's source is public. Read exactly how suptitle is executed, line by line, in Rust.
- View the source for suptitle in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/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.