Why are the resulting axes limits incorrect when I zoom in my MATLAB 7.0 (R14) figure using the zoom GUI plot tool?

1 view (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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])

More Answers (0)

Categories

Find more on Visual Exploration in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!