Permanently disable datacursor mode

10 views (last 30 days)
geotocho
geotocho on 24 Jun 2020
Edited: geotocho on 25 Jun 2020
I would like to disable the datacursormode from a figure which I am picking on using ginput. I have tried several ways to disable the datacursor as described here https://www.mathworks.com/help/matlab/ref/matlab.graphics.shape.internal.datacursormanager.html#d120e218623, but this has been ineffective.
Inside a while loop I am calling ginput once per iteration, and plotting the selected point on the figure. However, even after setting datacursormode off, inbetween calls to ginput the data cursor will automatically begin highlighting points for data tips. This is preventing my ginput picker from working effectively. Any advise would be helpful.
Thanks
minimum working example using matlab 2018b or later.
fig = figure(998); clf
dcm = datacursormode(fig);
dcm.Enable = 'off';
while 1
[x,y,btn] = ginput(1)
if isempty(btn)
break
end
plot(x,y,'rx')
drawanow
end

Accepted Answer

geotocho
geotocho on 25 Jun 2020
Edited: geotocho on 25 Jun 2020

More Answers (0)

Categories

Find more on Visual Exploration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!