Restore standard interactive axes behavior (callback) when using custom ButtonDownFcn

2 views (last 30 days)
Luca Amerio
Luca Amerio on 17 Oct 2019
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(~,~)
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

Answers (0)




Community Treasure Hunt

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

Start Hunting!