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.

 Akzeptierte Antwort

Jan
Jan am 14 Apr. 2021

0 Stimmen

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

5 Kommentare

Nils Tilton
Nils Tilton am 14 Apr. 2021
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.
Nils Tilton
Nils Tilton am 14 Apr. 2021
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 :)
Adam Danz
Adam Danz am 14 Apr. 2021
Don't forget to accept Jan's answer (blue accept answer button).
Glad you got it worked out!
Nils Tilton
Nils Tilton am 14 Apr. 2021
Thanks!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 13 Apr. 2021

Kommentiert:

am 14 Apr. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by