Re: Misbehavior in Zoom concerning XLim, YLim, ZLim; ZOOMAxesData
- From: "Daniel Sternberg" <dsternbe_NOSPAM@xxxxxxxxxxxxx>
- Date: Mon, 17 Oct 2005 11:17:17 -0400
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
>
>
.
- Follow-Ups:
- References:
- Prev by Date: Re: having problems with structures in mex
- Next by Date: Re: Version control for Matlab
- Previous by thread: Misbehavior in Zoom concerning XLim, YLim, ZLim; ZOOMAxesData
- Next by thread: Re: Misbehavior in Zoom concerning XLim, YLim, ZLim; ZOOMAxesData
- Index(es):
Relevant Pages
|