Skip to content

axis

Get or set axis limits and properties.

axis(limits)
axis('mode')
axis off
axis equal
lim = axis

Multi-mode axis-control function. With a 4-element vector [xmin xmax ymin ymax] (or 6-element for 3D), sets axis limits. With a mode string:

  • 'auto' — automatic limits
  • 'manual' — freeze current limits
  • 'tight' — limits to data extent
  • 'equal' — equal data-unit-per-pixel scaling
  • 'square' — square axes box
  • 'on' / 'off' — show / hide axis decorations

Without arguments, returns current limits.

axis([0 10 -1 1])
axis equal
axis tight
  • xlim — Get or set x-axis limits.
  • ylim — Get or set y-axis limits.
  • zlim — Get or set z-axis limits.
  • pbaspect — Get or set the plot box aspect ratio.
  • daspect — Get or set the data aspect ratio.