Re: Misbehavior in Zoom concerning XLim, YLim, ZLim; ZOOMAxesData



Lexinho,

This is not a bug, but rather a side effect of the order of the steps you
are executing. After you zoom in for the first time, the "original" axes
limits are saved. When you create a new plot in the same axes, this
information persists as the ZOOM function has no information about these
changes. After you modify the plot, execute the command

zoom reset

from the MATLAB command prompt. This will tell the function that the
"original" axes limits have now changed.

I hope this helps.

-Dan

---
Dan Sternberg
The MathWorks


"Lexinho" <felix.riemann@xxxxxxxxxxxx> wrote in message
news:dj0cet$emd$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi there,
>
> I found a strange behavior of the zoom function and ask for your help to
> solve this problem properly. My search on the Mathworks Matlab Newsgroup
> library gave no result about this issue.
>
> I've already improvised an ugly solution, so if we won't find a better
> way,
> this is a possibility.
>
> Here's the example code:
>
> ax = axes('nextplot', 'add');
> plot([1 2 3 4], [2 3 7 6], 'parent', ax);
> zoom('on');
>
> Check out the zoom function! Everything should be fine. Especially the
> doubleclick should result into zooming out to the original limits. Now
> create a new plot in the same axis but with different limits:
>
> delete(get(ax, 'Children'));
> plot([1000 2000 3000], [1000 3000 2000], 'parent', ax);
> set(ax, 'XLim', [1000 3000], 'YLim', [1000 3000]); % consider new limits
> zoom('on');
>
> Looks good so far, but if you now check out the zoom function, you will
> notice (or not?), that the double click results into zooming to the limits
> of the former plot. That's not very funny isn't it? For example, there is
> now no easy way to zoom the new plot properly.
>
> Analysing this behavior shows, that the 'XLimit' and 'YLimit' properties
> of
> the axes are set to the former settings by the zoom function. A deeper
> analysis shows, that the zoom function stores the original limits in an
> application data of the ZLabel with the name 'ZOOMAxesData' (sounds
> prettty
> improvised for me). By any circumstances now, this data will not be
> updated
> after deleting and creating a new plot. I suppose, that this is a bug (or
> maybe it's only a bug on R12.1). Correct me if I'm wrong!
>
> The easy but ugly solution I've found, is to reset this appdata manually,
> so
> that the zoom function is forced to create a new (up-to-date) one:
>
> setappdata(get(ax, 'ZLabel'), 'ZOOMAxesData', []);
>
>
> I'm running Matlab R12.1.
>
> Any comments, suggestions, corrections?
> I would be apreciated!
>
> Cheers
> Felix.
>
> ---
> Felix Riemann
> Robert Bosch Ltda.
> RBLA-DS/ENG3
> Curitiba, PR, Brazil
>
>


.



Relevant Pages

  • Re: Blu-ray/HD
    ... | zoom function, but given your report of your father's Panosonic DVD/ ... | stretch anything, but the with odd limitations depending on the format ... It has a setup menu with picture setting that has 2 different 4:3 icons ...
    (alt.tv.tech.hdtv)
  • Re: Zoom function for plotyy
    ... which will give a graph of plotyy (two y ... Also I have created a zoom function which would zoom on the ... the zoom only enlarge only one line of the plot. ... How do I program the zoom function that will zoom on all the lines on ...
    (comp.soft-sys.matlab)
  • Re: High Mag. at reduced Pixels.
    ... The normal Zoom Range of the FZ-50 is 12X, ... the Extended Optical Zoom function uses the center of the ... the 12x optical zoom extends to ...
    (rec.photo.digital)
  • Re: Inadvertent Zoom Change
    ... arrow keys, which moves me a word at a time to the left or right ... The problem is that occasionally when I am doing this, my zoom ... unpublished keyboard shortcut for the zoom function, ...
    (microsoft.public.word.docmanagement)
  • Re: Allow Interactive Zoom Only Once per Call
    ... call to the zoom function. ... a fraction of a second later, with the timer action being to ... set the zoom mode off. ...
    (comp.soft-sys.matlab)