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.

 採用された回答

Jan
Jan 2021 年 4 月 14 日

0 投票

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

5 件のコメント

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

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

質問済み:

2021 年 4 月 13 日

コメント済み:

2021 年 4 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by