RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • addpoints
    • ancestor
    • animatedline
    • area
    • axes
    • axis
    • bar
    • barh
    • box
    • caxis
    • cla
    • clf
    • clim
    • colorbar
    • colorcube
    • colormap
    • colororder
    • contour
    • contour3
    • contourf
    • copyobj
    • daspect
    • datacursormode
    • dataTipTextRow
    • errorbar
    • fcontour
    • figure
    • fill
    • fill3
    • findobj
    • fsurf
    • gca
    • gcf
    • get
    • gobjects
    • grid
    • groot
    • heatmap
    • hgload
    • hgsave
    • hidden
    • hist
    • histogram
    • histogram2
    • hold
    • image
    • imagesc
    • imshow
    • legend
    • line
    • linkaxes
    • loglog
    • mesh
    • meshc
    • openfig
    • opengl
    • pan
    • parula
    • patch
    • pie
    • plot
    • plot3
    • plotmatrix
    • plotyy
    • polarhistogram
    • polarplot
    • polarscatter
    • print
    • quiver
    • quiver3
    • ribbon
    • saveas
    • savefig
    • scatter
    • scatter3
    • semilogx
    • semilogy
    • set
    • sgtitle
    • shading
    • sphere
    • stackedplot
    • stairs
    • stem
    • subplot
    • subtitle
    • suptitle
    • surf
    • surfc
    • text
    • textscatter
    • textscatter3
    • title
    • triplot
    • view
    • waitbar
    • wordcloud
    • xlabel
    • xlim
    • xline
    • xscale
    • xtickangle
    • xtickformat
    • xticklabels
    • xticks
    • ylabel
    • ylim
    • yline
    • yscale
    • ytickangle
    • ytickformat
    • yticklabels
    • yticks
    • zlabel
    • zlim
    • zoom

axis — Query or set axis limits, visibility, and aspect behavior in MATLAB and RunMat plotting.

axis queries or configures limits, visibility, and aspect behavior for the active axes. It supports four-, six-, and eight-element numeric limit vectors, target-handle queries, logical or numeric visibility controls, and command forms such as axis equal, axis image, axis auto, and axis tight.

Syntax

lim = axis()
lim = axis(ax)
axis([xmin xmax ymin ymax | ... cmin cmax])
axis(mode)
axis(visibility)

Inputs

NameTypeRequiredDefaultDescription
axNumericScalarYes—Existing axes handle whose limits are queried.
limitsNumericArrayYes—Four-, six-, or eight-element x/y, x/y/z, or x/y/z/color limits vector.
modeStringScalarYes—Mode token: 'equal'|'image'|'auto'|'tight'|'manual'|'ij'|'xy'|'on'|'off'.
visibilityAnyYes—Axes visibility as on/off, logical true/false, or numeric 1/0.

Returns

NameTypeDescription
limNumericArrayCurrent x/y limits, with z limits included for a configured 3-D view.

Errors

IdentifierWhenMessage
RunMat:axis:InvalidArgumentAxis argument is unsupported, malformed, non-finite, or has invalid bounds ordering.axis: invalid argument

How axis works

  • axis() returns the current x and y limits as a four-element double vector, adding z limits for a configured 3-D view. axis(ax) queries the specified axes.
  • Four-, six-, and eight-element vectors set x/y, x/y/z, or x/y/z/color limits respectively. A -Inf lower endpoint or Inf upper endpoint retains the current data-fitted endpoint.
  • Limit vectors accept all eight integer classes. Authoritative integer storage is validated before one deliberate conversion into host double graphics state, and later limit queries return double.
  • axis('on'), axis('off'), logical scalars, and numeric zero or one control axes visibility. Numeric visibility accepts all eight integer classes.
  • axis equal enables equal aspect behavior on the current axes.
  • axis image enables equal aspect behavior and returns limits to data-fitted bounds, matching MATLAB's axis equal plus axis tight behavior.
  • axis auto clears explicit limits and returns to automatic fitting.
  • axis tight uses data-driven fitting behavior while leaving figure-local plot contents unchanged.
  • Axis settings are subplot-local because they act on the active axes state.
  • GPU-resident limits and visibility controls reject before provider access because axis is a host graphics-state operation and exposes no interactive GPU-array input surface.
  • Multiple mode arguments, target-handle setter forms, mode subsets, and complete direction/style mode effects remain general graphics compatibility gaps.

Does RunMat run axis on the GPU?

axis performs no provider dispatch; resident limits and visibility controls reject rather than gathering.

GPU memory and residency

axis returns host-side limit vectors and does not change array GPU residency.

Examples

Set explicit x and y limits

plot(0:0.1:10, sin(0:0.1:10));
axis([0 10 -1 1]);

Force equal axis scaling

t = linspace(0, 2*pi, 200);
plot(cos(t), sin(t));
axis equal;

Display image data with square pixels

imagesc([1 2; 3 4]);
axis image;

Return to automatic fitting inside a subplot

subplot(1, 2, 1);
plot(1:5, [1 4 2 5 3]);
axis tight;
subplot(1, 2, 2);
plot(1:5, [5 4 3 2 1]);
axis auto;

Using axis with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how axis changes the result.

Run a small axis example, explain the result, then change one input and compare the output.

FAQ

How do I get equal aspect ratio so circles look like circles?⌄

Call axis equal after your plot command. This forces one unit on x to equal one unit on y in screen space. Without it, a circle drawn with plot(cos(t), sin(t)) will appear as an ellipse if the figure isn't perfectly square.

t = linspace(0, 2*pi, 200);
plot(cos(t), sin(t));
axis equal;
How do I set manual axis limits?⌄

Pass a four-element vector: axis([xmin xmax ymin ymax]). For 3-D plots, use six elements: axis([xmin xmax ymin ymax zmin zmax]); append color limits for the eight-element form. Use -Inf for an automatic lower endpoint or Inf for an automatic upper endpoint. Explicit bounds override auto-fitting until you call axis auto.

What does axis tight actually do?⌄

axis tight fits the axes limits snugly around the plotted data with no padding. Compare to axis auto, which may add margin for readability. Use tight when you want the data to fill the entire axes area — useful for image-like plots or when whitespace is wasted space.

What does axis image do?⌄

axis image combines equal aspect behavior with data-fitted limits. It is intended for image displays where pixels should appear square and the axes should fit the image data.

Related Plotting functions

2D Charts

area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem

3D & Surface

contour · contour3 · contourf · mesh · meshc · plot3 · quiver · scatter3 · surf · surfc

Images

image · imagesc · imshow

Axes & Layout

box · grid · sgtitle · subplot · title · view · zlabel

Appearance

colorbar · colormap · legend · shading

Handle Access

gca · gcf · get · set

Other

addpoints · ancestor · animatedline · axes · barh · caxis · cla · clf · clim · colorcube · colororder · copyobj · daspect · datacursormode · dataTipTextRow · fcontour · figure · fill · fill3 · findobj · fsurf · gobjects · groot · hgload · hgsave · hidden · histogram2 · hold · line · linkaxes · openfig · opengl · pan · parula · patch · plotmatrix · plotyy · polarhistogram · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · stackedplot · subtitle · suptitle · text · textscatter · textscatter3 · triplot · waitbar · wordcloud · xlabel · xlim · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · ylabel · ylim · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zlim · zoom

More plotting resources

  • Choosing the right plot type
  • Styling plots and axes
  • Plot replay and export
  • Complete plotting guide

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how axis is executed, line by line, in Rust.

  • View the source for axis in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How axis works
  • Does RunMat run axis on the GPU?
  • GPU memory and residency
  • Examples
  • Set explicit x and y limits
  • Force equal axis scaling
  • Display image data with square pixels
  • Return to automatic fitting inside a subplot
  • Using axis with coding agents
  • FAQ
  • Related Plotting functions
  • 2D Charts
  • 3D & Surface
  • Images
  • Axes & Layout
  • Appearance
  • Handle Access
  • Other
  • More plotting resources
  • Open-source implementation
  • About RunMat