datacursormode — Control data cursor interaction mode for figures.

datacursormode toggles or configures MATLAB-compatible data cursor mode state. It returns a live data cursor manager object whose common properties can be read or updated through get and set.

Syntax

dcm = datacursormode()
datacursormode()
status = datacursormode(option)
dcm = datacursormode(fig)
status = datacursormode(fig, option)

Inputs

NameTypeRequiredDefaultDescription
optionStringScalarYesMode option: on, off, or toggle.
figNumericScalarYesTarget figure handle.

Returns

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

Errors

IdentifierWhenMessage
RunMat:datacursormode:InvalidArgumentArgument count, figure handle, option, or property is invalid.datacursormode: invalid argument
RunMat:datacursormode:InternalInternal data cursor state or handle-object update fails.datacursormode: internal operation failed

GPU memory and residency

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

Examples

Enable data cursor mode

plot(1:10);
datacursormode on;

Expected output:

% Data cursor mode is enabled

Use the data cursor manager object

dcm = datacursormode;
set(dcm, 'DisplayStyle', 'window', 'SnapToDataVertex', 'off');
get(dcm, 'DisplayStyle')

Expected output:

ans = 'window'

Using datacursormode with coding agents

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

Run a small datacursormode 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.