Azzera filtri
Azzera filtri

Setting ButtonDownFcn disables default datatip functionality on hover

5 visualizzazioni (ultimi 30 giorni)
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 Commenti
Jonatha Reis
Jonatha Reis il 17 Giu 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 il 17 Giu 2022
No, I manually swap between the two modes by selecting/deselecting the Datatips feature in the figure itself.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by