tiledlayout
Create tiled chart layout for displaying subplots
Syntax
Description
tiledlayout
creates a tiled
chart layout for displaying multiple plots, also called subplots, in the current figure. The
layout can display any number of plots and reflow according to the size of the figure and
the number of axes. If there is no figure, MATLAB® creates a figure and places the layout into it. If the current figure contains
an existing layout or axes, MATLAB replaces it with a new layout. (since R2024b)
A tiled chart layout contains an invisible grid of tiles that covers the entire figure
or parent container. Each tile can contain an axes object for displaying a plot. After
creating a layout, call the nexttile
function to place an axes object into the layout. Then call a plotting function to plot into
the axes.
tiledlayout(
creates a layout that
can hold any number of axes. Initially, there is only one empty tile that fills the entire
layout. Specify an arrangement value to control the placement of subsequent axes:arrangement
)
"flow"
— Create a layout for a grid of axes that can reflow depending on the size of the figure and the number of axes."vertical"
— Create a layout for a vertical stack of axes. (since R2023a)"horizontal"
— Create a layout for a horizontal stack of axes. (since R2023a)
You can specify the arrangement
argument without
parentheses. For example, tiledlayout vertical
creates a layout for a
vertical stack of axes.
tiledlayout(___,
specifies additional options for the layout using one or more name-value pair arguments.
Specify the options after all other input arguments. For example,
Name,Value
)tiledlayout(2,2,"TileSpacing","compact")
creates a 2-by-2 layout with
minimal spacing between the tiles. For a list of properties, see TiledChartLayout Properties.
tiledlayout(
creates
the layout in the specified parent container rather than in the current figure. Specify the
parent container before all other input arguments.parent
,___)
t = tiledlayout(___)
returns the
TiledChartLayout
object. Use t
to configure
properties of the layout after creating it.