필터 지우기
필터 지우기

Setting ButtonDownFcn disables default datatip functionality on hover

조회 수: 5 (최근 30일)
Ahmad Khaled
Ahmad Khaled 2020년 4월 15일
댓글: Ahmad Khaled 2022년 6월 17일
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
Jonatha Reis
Jonatha Reis 2022년 6월 17일
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 2022년 6월 17일
No, I manually swap between the two modes by selecting/deselecting the Datatips feature in the figure itself.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by