Effacer les filtres
Effacer les filtres

I've tried using both Interactions and datacursormode to disable Datatips without success across multiple UIAxes in a single UIFigure

14 vues (au cours des 30 derniers jours)
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.

Réponses (1)

Tushar
Tushar le 29 Août 2023
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.

Catégories

En savoir plus sur Develop uifigure-Based Apps dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by