Thread Subject: Check zoom

Subject: Check zoom

From: Lakshmi

Date: 17 Jan, 2008 21:12:02

Message: 1 of 2

Hi all,

I have used the following code,

zoom on
set(fig_ttest,'WindowButtonDownFcn');
C = get(gca,'CurrentPoint');
points =(1,1)
         (3,2),etc.
zoom_factor=2;
If the current point C is equal to any one of the above points
I want to set the Xlim and Ylim and also zoom(zoom_factor).

If C is not equal to any points just zoom(zoom_factor)
But here I want to check whether the zoom is on or not, to
execute zoom(zoom_factor);

Thank you

Mekala

Subject: Check zoom

From: Anh Huy Phan

Date: 18 Jan, 2008 07:45:03

Message: 2 of 2

"Lakshmi " <lmekala@slb.com> wrote in message
<fmogb2$276$1@fred.mathworks.com>...
> Hi all,
>
> I have used the following code,
>
> zoom on
> set(fig_ttest,'WindowButtonDownFcn');
> C = get(gca,'CurrentPoint');
> points =(1,1)
> (3,2),etc.
> zoom_factor=2;
> If the current point C is equal to any one of the above
points
> I want to set the Xlim and Ylim and also
zoom(zoom_factor).
>
> If C is not equal to any points just zoom(zoom_factor)
> But here I want to check whether the zoom is on or not,
to
> execute zoom(zoom_factor);
>
> Thank you
>
> Mekala
>

Suppose fig is handles of your figure

fig = figure;
%% plot something
..

Create zoom object of the figure fig

h = zoom(fig);


Get the zoom status of the current axes (in fig)

zoomflg = isAllowAxesZoom(h,gca);

0: OFF mode
1: ON mode

Set new zoom status to the axes

setAllowAxesZoom(h,gca,~zoomflg);


Anh Huy Phan
RIKEN - BSI

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com