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.

 Risposta accettata

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

5 Commenti

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!
Thanks!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Creating, Deleting, and Querying Graphics Objects in Centro assistenza e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by