xtickangle — Query or set X-axis tick label rotation.

xtickangle returns or updates the X-axis tick label rotation in degrees for the current axes or specified axes handles.

Syntax

angle = xtickangle()
xtickangle(angle)
angle = xtickangle(ax)
xtickangle(ax, angle)

Inputs

NameTypeRequiredDefaultDescription
angleNumericScalarYesX-axis tick label rotation in degrees.
axAxesHandleYesScalar target axes handle.
axAxesHandleYesTarget axes handle or array of axes handles.

Returns

NameTypeDescription
angleNumericScalarCurrent X-axis tick label rotation in degrees.

Errors

IdentifierWhenMessage
RunMat:xtickangle:InvalidArgumentArgument count, angle value, or axes handle is invalid.xtickangle: invalid argument
RunMat:xtickangle:InternalInternal plotting state update fails.xtickangle: internal operation failed

How xtickangle works

  • xtickangle() returns the current X tick label rotation, defaulting to 0.
  • xtickangle(angle) sets the current axes X tick label rotation in degrees.
  • xtickangle(ax) queries a scalar axes handle without changing the current axes.
  • xtickangle(ax, angle) accepts a scalar axes handle or numeric array of axes handles and sets each target.
  • The function shares state with XTickLabelRotation on axes and TickLabelRotation on the X-axis ruler returned by get(ax, 'XAxis').

GPU memory and residency

xtickangle only reads and writes axes metadata. It does not inspect, gather, or transform GPU-resident plot data.

Examples

Rotate X tick labels

plot(1:3);
xtickangle(45);
xtickangle()

Expected output:

ans = 45

Target a specific axes

ax = subplot(1, 2, 1);
xtickangle(ax, -30);

Using xtickangle with coding agents

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

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

Open-source implementation

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

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.