pan — Control interactive axes panning for figures and axes.

pan toggles or configures MATLAB-compatible figure panning state. It supports figure and axes targets, returns a live pan mode object, and integrates with get and set for common pan object properties.

Syntax

p = pan()
pan()
status = pan(option)
status = pan(target, option)
p = pan(fig)

Inputs

NameTypeRequiredDefaultDescription
optionStringScalarYesPan option: on, off, toggle, xon, or yon.
targetAnyYesFigure or axes handle.
optionAnyYesPan option.
figNumericScalarYesTarget figure handle.

Returns

NameTypeDescription
pAnyPan mode object for the current or specified figure.
statusStringScalarReturns "ok" when the pan command succeeds.

Errors

IdentifierWhenMessage
RunMat:pan:InvalidArgumentArgument count, target handle, option, or pan property is invalid.pan: invalid argument
RunMat:pan:InternalInternal pan state or handle-object update fails.pan: internal operation failed

GPU memory and residency

pan mutates plotting interaction metadata only. It does not gather or copy GPU-resident plot data.

Examples

Enable horizontal panning

plot(1:10);
pan xon;

Expected output:

% Pan mode is enabled horizontally

Use the pan object with get and set

p = pan;
set(p, 'Enable', 'on', 'Motion', 'vertical');
get(p, 'Motion')

Expected output:

ans = 'vertical'

Using pan with coding agents

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

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

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.