Skip to content

xlim

Plot limits for the x-axis

xlim([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.

xlim

  • It returns the current limits.

xlim('mode')

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

xlim('auto')

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

xlim('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.
  • The following touch interactions change 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