To enable the ability to turn off pan or zoom in the post action callback, you must set the "ModeHandle" 's "Blocking" property to false. This feature is undocumented and is not even visible when the property 'hideundocumented' is set to 'off'.
For "zoom": Use the following code in the post action callback to turn off the zoom using the set function:
function myzoompostcallback(obj,evd)
hZ = zoom(obj);
hM = hZ.ModeHandle;
set(hM,'Blocking',false);
set(hZ,'Enable','off');
Use the following code in the post action callback to turn off the zoom using dot notation:
function myzoompostcallback(obj,evd)
hZ = zoom(obj);
hZ.ModeHandles.Blocking = false;
hZ.Enable = 'off';
For "pan":
Use the following code in the post action callback to turn off the pan using the set function:
function mypanpostcallback(obj,evd)
hP = pan(obj);
hM = hP.ModeHandle;
set(hM,'Blocking',false);
set(hP,'Enable','off');
Use the following code in the post action callback to turn off the pan using dot notation:
function mypanpostcallback(obj,evd)
hP = pan(obj);
hP.ModeHandles.Blocking = false;
hP.Enable = 'off';
Best Answer