Stacked plot of several variables with common x-axis
stackedplot(
plots the variables of a
table or timetable in a stacked plot, up to a maximum of 25 variables. The function plots
the variables in separate y-axes, stacked vertically. The variables
share a common x-axis.tbl
)
If tbl
is a table, then the function plots the variables
against row numbers.
If tbl
is a timetable, then the function plots the variables
against row times.
The stackedplot
function plots all the numeric, logical,
categorical, datetime, and duration variables of tbl
, and ignores table
variables having any other data type.
stackedplot(___,'XVariable',
specifies the table variable that provides the x-values for the
stacked plot. This syntax supports only tables, and not timetables.xvar
)
stackedplot(
plots the columns of
Y
)Y
versus their row number. The x-axis scale
ranges from 1 to the number of rows in Y
.
stackedplot(___,
sets
the line style, marker symbol, and color. You can use this syntax with the input arguments
of any of the previous syntaxes.LineSpec
)
stackedplot(___,
sets
properties for the stacked plot using one or more Name,Value
)Name,Value
pair
arguments. For a list of the properties, see StackedLineChart Properties. Use this option with any of the input argument combinations in the
previous syntaxes. Name-value pair settings apply to all the plots in the stacked plot.
Enclose each property name in quotes.
stackedplot(
creates
the stacked plot in the figure, panel, or tab specified by parent
,___)parent
. The
option parent
can precede any of the input argument combinations in the
previous syntaxes.
returns a
s
= stackedplot(___)StackedLineChart
object. You can use s
to change
properties of the stacked plot after you have created it. For a list of properties, see
StackedLineChart Properties.
To interactively explore the data in your stacked plot, use these features.
Zoom — Use the scroll wheel to zoom.
Pan — Click and drag the stacked plot to pan across the x-values.
Data cursor — Hover over a location to display y-values for each plot.