Here is the function of interest. It scales the Y axis with each increase / decrease. the sinh transformation is used, but it can be any transformation.
The main Matlab function behind it is "ActionPostCallback". See http://www.mathworks.fr/fr/help/matlab/ref/zoom.html for more details. You can also use the analog function "ActionPreCallback". These small handy functions can also be used for the main functions "rotate3d", "pan", "zoom" and "brush".
function applyCustomScalingWhenZooming %some data x=1:1/1000:100; y=1:1/1000:100; %figure figure; plot (x, asinh (2*y)); set (gca, 'YTickLabel', ... num2str ((sinh (get (gca, 'YTick')) / 2)(:), '%g')); %initial format %defines callback when zoom action h = zoom; %define handle for 'zoom' %action to be called right after zooming set(h,'ActionPostCallback', {@mypostcallback}); function mypostcallback(obj,event_obj) %format function set (gca, 'YTickLabel', ... num2str ((sinh (get (gca, 'YTick')) / 2)(:), '%g'));
source share