Skip to content


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.


  • It returns the current limits.


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


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


  • It switches to 'manual' mode.


  • 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