Stop automatically showing "data tips"

Ever since I updated to Matlab 2020, there is an annoying feature such that if I happen to click the cursur in a figure, it will add a little "pin" showing the coordinates of the closest data point. Can I turn this new feature off? It's causing me lots of problems.

 采纳的回答

Include this in the startup.m function:
if ~verLessThan('MATLAB','9.7')
set(groot, 'defaultAxesCreateFcn', @(ax,~) disableDefaultInteractivity(ax))
end

5 个评论

Thanks, I tried that earlier, but it didn't seem to work. I wonder if it has to do with the "if ~verLessThan('MATLAB','9.7')". Could you explain what that if statement is needed for?
Could you explain what didn't work?
verLessThan merely determines if your current Matlab release is r2019b (9.7) or later but disableDefaultInteractivity was released in r2018b so I believe the condition should be,
if ~verLessThan('MATLAB','9.5')
disableDefaultInteractivity(ax) turns off data tip interactivity unless you re-enable it by pressing the datatip tool button or something else turns it back on for those axes.
For some reason, the change didn't take at first, even after I restarted matlab a few times. But now, it seems to work. At one point, I removed the if statement, but I am not sure if that's what did the trick. In any case, it works now! Thanks very much to both of you for your help :)
Don't forget to accept Jan's answer (blue accept answer button).
Glad you got it worked out!

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by