# ylim

Plot limits for the y-axis

### ylim([a b])

• It sets the lower and upper limits to a and b, respectively, and switches to manual mode.
• a and b should be scalars with a < b.

### ylim

• It returns the current limits.

### ylim('mode')

• It returns the current mode, either 'auto' or 'manual'.

### ylim('auto')

• It switches to 'auto' mode, and limits are generated automatically.

### ylim('manual')

• It switches to 'manual' mode.

Note

• If the hold state is off, execution of the next plot or surf function will reset it to auto mode. Otherwise, the mode and limits remain unchanged.
• Touch interaction changes limit mode:

Action Line Plot Being Shown Surface Plot Being Shown
Pinch (zoom) Switch to manual Unchanged
2-finger pan (translate) Switch to manual Unchanged
3-finger pan (rotate) Not applicable Unchanged
Double tap (reset view) Switch to auto Unchanged