Adjust Matlab data cursor precision

MATLAB data cursor default: 4 digits of precision. Here’s how to increase the precision for the Matlab data cursor.

Matlab ≥ R2014b

Use custom function callback.

Matlab ≤ R2014a

This only works for Matlab ≤ R2014a.

  1. open the config file
    nano $(dirname $(realpath $(which matlab)))/../toolbox/matlab/graphics/@graphics/@datacursor/default_getDatatipText.m
  2. Adjust DEFAULT_DIGITS value:
    function [str] = local_Geometry_getDatatipText(hgObject,hDataCursor)
    DEFAULT_DIGITS = 4;  % Display 4 digits of x,y position
  3. Restart Matlab


Written by Michael Hirsch, Ph.D. //