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

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

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.

LicensePrivacy
/
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

subtitle — Set subtitle text for the current axes or a specified axes handle with MATLAB-compatible subtitle forms.

subtitle attaches secondary title text to individual axes and returns a text handle for property updates. It follows MATLAB-compatible axes-scoped behavior and is separate from figure-level title helpers such as sgtitle and suptitle.

Syntax

h = subtitle(txt)
h = subtitle(ax, txt)
h = subtitle(txt, Name, Value, ...)
h = subtitle(ax, txt, Name, Value, ...)

Inputs

NameTypeRequiredDefaultDescription
txtAnyYes—Subtitle text (string/char/cellstr-like multiline forms).
axAxesHandleYes—Target axes handle.
propsAnyVariadic—Property/value pairs (Color, FontSize, FontWeight, etc.).

Returns

NameTypeDescription
hNumericScalarHandle to the created/updated subtitle object.

Errors

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

How subtitle works

  • The returned value is a text handle that can be inspected or updated through get and set.
  • With no explicit target, subtitle attaches text to the current axes as returned by gca.
  • Passing an axes handle as the first argument targets that specific axes, which is useful in subplot layouts.
  • String scalars, char arrays, string arrays, and cell arrays are all accepted. String arrays and cell arrays produce multiline subtitles, with elements joined by newlines.
  • Text styling properties such as FontSize, FontWeight, FontAngle, Color, Interpreter, and Visible use the shared plotting text-property system.
  • FontSize accepts every native integer class as well as floating-point scalars. The value crosses the graphics floating boundary only after exact scalar validation.
  • Axes handles are normally the double handles returned by plotting functions. Typed-integer aliases for encoded axes handles are available only when RunMat extensions are enabled and are rejected in strict compatibility mode before graphics state changes.
  • get(ax, 'Subtitle') returns the subtitle text handle for that axes. get(h, 'String') returns the subtitle text for the subtitle handle.

Examples

Add a title and subtitle to the current axes

plot(0:0.1:2*pi, sin(0:0.1:2*pi));
title('Sine Wave');
subtitle('One period sampled every 0.1 radians');

Expected output:

% title and subtitle are rendered above the axes

Style the subtitle and inspect its handle

plot(1:10, rand(1, 10));
h = subtitle('Trial A', 'FontSize', 12, 'FontWeight', 'bold');
get(h, 'Type')

Expected output:

ans =
    'text'

Set independent subtitles on subplot panels

ax1 = subplot(1, 2, 1);
plot(ax1, 1:5, 1:5);
ax2 = subplot(1, 2, 2);
plot(ax2, 1:5, (1:5).^2);
subtitle(ax1, 'Linear response');
subtitle(ax2, 'Quadratic response');

Expected output:

% Subtitles are attached to their respective axes

Create a multiline subtitle from a cell array

plot(1:5, [2 4 1 3 5]);
subtitle({'Experiment 7', 'Filtered signal'});

Expected output:

% Both cell elements appear as separate subtitle lines

Update a subtitle after plotting using set

plot(1:10, rand(1, 10));
h = subtitle('Draft');
set(h, 'String', 'Final Subtitle', 'Color', 'r');

Expected output:

% The axes subtitle is updated in place

Using subtitle with coding agents

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

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

FAQ

How is subtitle different from title?⌄

title sets the primary axes title. subtitle sets a second text line associated with the same axes and is rendered below the primary title when both are present.

Can I target a specific subplot?⌄

Yes. Pass the axes handle returned by subplot or gca as the first argument.

ax = subplot(2, 1, 1);
subtitle(ax, 'Top panel details');
Can I update the subtitle after creating it?⌄

Yes. subtitle returns a text handle, so you can update it with set.

h = subtitle('Initial');
set(h, 'String', 'Updated', 'FontSize', 12);
Can FontSize be an integer value?⌄

Yes. All eight native integer classes are accepted for FontSize, and practical positive sizes are validated exactly before entering the renderer's floating-point graphics domain.

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

Open-source implementation

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

  • View the source for subtitle 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 subtitle works
  • Examples
  • Add a title and subtitle to the current axes
  • Style the subtitle and inspect its handle
  • Set independent subtitles on subplot panels
  • Create a multiline subtitle from a cell array
  • Update a subtitle after plotting using set
  • Using subtitle 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