Borrar filtros
Borrar filtros

Setting ButtonDownFcn disables default datatip functionality on hover

5 visualizaciones (últimos 30 días)
Ahmad Khaled
Ahmad Khaled el 15 de Abr. de 2020
Comentada: Ahmad Khaled el 17 de Jun. de 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 comentarios
Jonatha Reis
Jonatha Reis el 17 de Jun. de 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 el 17 de Jun. de 2022
No, I manually swap between the two modes by selecting/deselecting the Datatips feature in the figure itself.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by