ylim sets or queries values of the axes
object YLimand YLimMode property.
When the axis limit mode is set to auto (the
default), MATLAB® uses limits, which are round numbers, to span
the range of the data being displayed. Setting a value for any of
the limits also sets the corresponding mode to manual.
If you set the limits on an existing graph and want to maintain these
limits while adding more graphs, use the hold command.
High-level plotting functions like plot and surf reset
both the modes and the limits.