MATLAB: Are the resulting axes limits incorrect when I zoom in the MATLAB 7.0 (R14) figure using the zoom GUI plot tool

areafiguregcalimitlimitsMATLABsmallxlimylim;zoom

I have the following code:
y = sin(2*pi*0.05*[1:24]);
plot(y,'r')
When I try to zoom in on a very narrow X axis region with little Y axis zoom and vice versa, the resultant plot is zoomed in on a different region than what was specified by the cursor.

Best Answer

This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This has been verified as a bug in MATLAB 7.0 (R14) in the way that the zoom plot tool zooms in on regions that are very small.
Currently, to work around this issue, try using the SET function to specify the axes' limits. For example:
y = sin(2*pi*0.05*[1:24]);
plot(y,'r')
You can zoom in on the figure between x = 20 and x = 20.01 with the following code:
set(gca,'xlim',[20 20.01])