ylim
set or get y-axis limits.
📝Syntax
lims = ylim()
ylim([ymin, ymax])
ylim('auto')
ylim('manual')
m = ylim('mode')
ylim(ax, ...)
📥Input Arguments
Parameter Description
[ymin, ymax] y-coordinates: vector or matrix.
'auto' enable automatic limit selection.
'manual' freeze the y-axis limits at their current value.
'mode' returns the current y-axis limits mode.
ax a scalar graphics object value: parent container, specified as a axes.
📤Output Arguments
Parameter Description
lims two-element vector: [ymin, ymax]
m 'auto' or 'manual'.
📄Description

ylim get or set the limits of the y-axis for the current plot.

💡Examples
x = linspace(-1, 1);
y = sin(2*pi*x);
plot(x, y);
lim = ylim()
m = ylim('mode')
🔗See Also
axesaxis
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub