Permanently disable datacursor mode

조회 수: 5 (최근 30일)
geotocho
geotocho 2020년 6월 24일
댓글: Sang Kim 2024년 5월 2일
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

채택된 답변

geotocho
geotocho 2020년 6월 25일
편집: geotocho 2020년 6월 25일

추가 답변 (1개)

Sang Kim
Sang Kim 2024년 4월 29일
How many times should I set this? I set startup.m with set( groot , 'defaultAxesCreateFcn' , 'disableDefaultInteractivity(gca)' ). It showed in my GUI. I tried to insert in each figure like this, disableDefaultInteractivity(Anal.gui.axes(1)).
But, it shows again. How do I remove this one. I upgraded from Matlab 2013a to 2024a. The 2024a version matlab is really bad because of this. I cannot give client because of this x, y value showing whenever I click on the graph. Please and please complete remove this function. Don't make smart people confused. Please remove it or don't set it default.
  댓글 수: 1
Sang Kim
Sang Kim 2024년 5월 2일
I have tried to insert the following in my startup.m and it worked.
set(groot,'DefaultAxesToolbarVisible',false);
set(groot,'defaultAxesCreateFcn', @(ax,~) set(ax,'Interactions',[]));

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by