I've tried using both Interactions and datacursormode to disable Datatips without success across multiple UIAxes in a single UIFigure
17 次查看(过去 30 天)
显示 更早的评论
I've used the following code in an attempt to disable Data Tips on four UIAxes within a single App Designer UIFigure. All plotted lines and surfaces have HitTest "off".
% Remmove dataTip iteraction
app.UIAxesfLL.Interactions= [];
% [panInteraction zoomInteraction...
% rotateInteraction rulerPanInteraction];
app.UIAxesbLL.Interactions= [];
% [panInteraction zoomInteraction...
% rotateInteraction rulerPanInteraction];
app.UIAxesfIS.Interactions= [];
% [panInteraction zoomInteraction...
% rotateInteraction rulerPanInteraction];
app.UIAxesbIS.Interactions= [];
% [panInteraction zoomInteraction...
% rotateInteraction rulerPanInteraction];
% Try to disable Tooltip with datacursor mode
datacursormode(app.UIFigure, "off");
The UIFigure consists of two panels one of which is shown below. Each UIAxes can present a simple grid drawn with plot and/or a surface rendered with either fill or fill3.
If I present a simple grid drawn with multiple plot commands no Data Tips appear. Typical grid shown below.
If I render the plots with a surface, fill or fill3 Data Tips continue to appear, but only on the top surface. Both UIAxes have been identically configured.
A surface generation code sample is shown below:
app.surf.(sXX).hSurf= fill3(app.surf.(sXX).hAxes,...
app.surf.(sXX).xVtx, app.surf.(sXX).yVtx, ...
app.surf.(sXX).zVtx, surfVtx,...
'FaceAlpha',.5, 'EdgeColor', [.5 .5 .5],...
'EdgeAlpha', .5,'HitTest','off');
I've looked at disableDefaultInteractivity, but it's function would appear identical to setting Interactions to [].
The user does interact with these data using the Axes ButtonDown callback and that continues to work as expect.
0 个评论
回答(1 个)
Tushar
2023-8-29
Hi Richard,
I understand that you want to disable automatic data tip creation in one of your plots. From the information provided, it is unclear which version of MATLAB you are using. However, there is a MATLAB Answer on the community that addresses a similar issue: "Disable automatic Data Tips", using MATLAB version R2019b.
Additionally, I am attaching some relevant links/resources for you to refer to:
I hope these resources should provide you with further guidance on how to disable automatic data tip creation in your plots.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!