Restore standard interactive axes behavior (callback) when using custom ButtonDownFcn
2 views (last 30 days)
Show older comments
In the latest MATLAB versions, by default, axes got a very neet degree of interactivity.
For example, just doing
[X,Y,Z] = peaks(25);
h = surf(X,Y,Z,Z);
clicking on the axes allows to 3d orbit, zoom with the mouse wheel and show a data-tit when hovering over a point. Everything without using the "orbit", "zoom" or "data tips" buttons.
However, if we add an interactive callback to the figure, for example doing
h.ButtonDownFcn = @my_hit_fun;
function my_hit_fun(~,~)
disp('hit')
the interactive behavior is completely gone.
NOTE: we added a button down function to the surface, but the interactive behaviour is not triggered not even when clicking on the background.
Is there a way to restore this behavior , at least when 'my_hit_fun' is not triggered? Something like:
if I_hit_something_with_a_callback
execute_my_callback
else
normal_behavior
end
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!