Search code examples
matlabgridcursor

MATLAB Data Cursor won't click on every point of plot (R2018b)


I need to get the plot values in between those two points, but when I click with the data cursor in between, the label appears either left or right, as if the cursor only picks up points on a fixed grid.

Is there a way to increase this precision so I can click and get the values in between?


Solution

  • Found the solution:

    In the code, this needs to be set after the plot:

    dcmObj = datacursormode;
    set(dcmObj,'SnapToDataVertex','off')