Effacer les filtres
Effacer les filtres

Setting ButtonDownFcn disables default datatip functionality on hover

5 vues (au cours des 30 derniers jours)
Ahmad Khaled
Ahmad Khaled le 15 Avr 2020
Commenté : Ahmad Khaled le 17 Juin 2022
Hello,
Matlab nicely has the builtin feature of viewing the data tips when the mosue hovers on a point in a plot.
However, when I try to set the ButtonDownFcn of the plot, this default data tip functionality is disabled.
Is there a way to have both: View data points on hover and fire a function when the plot is clicked?
Example:
figure()
a=plot(1:10,1:10)
%Figure now shows data tips perfectly
set(a,'HitTest', 'on', 'ButtonDownFcn',@(varargin)disp('Anything'))
%Running the last line disables the datatips on hovering to enable firing the disp function when plot is clicked
Many thanks!
  5 commentaires
Jonatha Reis
Jonatha Reis le 17 Juin 2022
Did you manage to solve this issue? I am having the same problem and I just can't find the solution...
Ahmad Khaled
Ahmad Khaled le 17 Juin 2022
No, I manually swap between the two modes by selecting/deselecting the Datatips feature in the figure itself.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by