stairs
Stairstep graph.
📝 Syntax
stairs(Y)
stairs(X, Y)
stairs(..., LineSpec)
stairs(..., Name, Value)
stairs(ax, ...)
h = stairs(...)
[xb, yb] = stairs(...)
📥 Input argument
X - x values.
Y - y values.
LineSpec - Line style, marker and/or color: character vector or scalar string.
propertyName - a scalar string or row vector character.
propertyValue - a value.
ax - Axes object.
📤 Output argument
h - line object.
xb - x values for use with plot
yb - y values for use with plot
📄 Description
Stairstep graphs are a valuable tool for creating time-history plots of digitally sampled data.
stairs(Y) function is used to generate such graphs by plotting the elements of the vectorY.
IfY is a matrix, it draws one line for each column, with the color of the lines determined by the ColorOrder property of the axes.
In the case of a vectorY, the x-axis scale spans from 1 to the length ofY, while for a matrixY, the x-axis scale ranges from 1 to the number of rows inY.
stairs(X, Y) allows you to plot the elements inY at specific locations defined by the vector X.
It's important to note that the elements in X must be in a monotonic order to create a valid stairstep graph.
💡 Examples
🔗 See also
plot.
🕔 History
1.0.0
initial version
Last updated
Was this helpful?