Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: zoom

Subject: zoom

From: shopana

Date: 29 Jan, 2008 08:41:02

Message: 1 of 7

hi,
  i want to zoom in and zoom out the axis with help of
slider.i.e., by moving the slider position min to max.Is
this posible.can somone help me? Thanks a lot.

Subject: Re: zoom

From: Vihang Patil

Date: 29 Jan, 2008 09:01:03

Message: 2 of 7

"shopana " <shopana.e@hcl.in> wrote in message
<fnmoqu$3sv$1@fred.mathworks.com>...
> hi,
> i want to zoom in and zoom out the axis with help of
> slider.i.e., by moving the slider position min to max.Is
> this posible.can somone help me? Thanks a lot.

doc zoom
use zoom(factor) in your slider function
HTH
Vihang

Subject: Re: zoom

From: shopana

Date: 29 Jan, 2008 09:16:02

Message: 3 of 7

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fnmq0f$h6j$1@fred.mathworks.com>...
> "shopana " <shopana.e@hcl.in> wrote in message
> <fnmoqu$3sv$1@fred.mathworks.com>...
> > hi,
> > i want to zoom in and zoom out the axis with help of
> > slider.i.e., by moving the slider position min to
max.Is
> > this posible.can somone help me? Thanks a lot.
>
> doc zoom
> use zoom(factor) in your slider function
> HTH
> Vihang


thanks for your speedy reply.can you give me simple
example in slider using zoom(factor).

Subject: Re: zoom

From: Vihang Patil

Date: 29 Jan, 2008 10:52:02

Message: 4 of 7

"shopana " <shopana.e@hcl.in> wrote in message <fnmqsi$s79
> thanks for your speedy reply.can you give me simple
> example in slider using zoom(factor).

Example:

function slidertp
load clown
h = figure,imshow(X,map);
h1 = uicontrol('Style','Slider','Callback',{@myzoom,h});

function myzoom(obj,event,h)
val = get(obj,'Value');
if isempty(get(obj,'UserData'))
    val_temp = val;
    set(obj,'UserData',val_temp);
else
    val_temp = get(obj,'UserData');
end
if val>=val_temp
    zoom(h,1.01);%zoom factor
    val_temp = val;
    set(obj,'UserData',val_temp);
else
    zoom(h,0.99);%zoom factor
    val_temp = val;
    set(obj,'UserData',val_temp);
end


HTH
Vihang

Subject: Re: zoom

From: shopana

Date: 12 Feb, 2008 11:48:02

Message: 5 of 7

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fnn0gi$4ll$1@fred.mathworks.com>...
> "shopana " <shopana.e@hcl.in> wrote in message
<fnmqsi$s79
> > thanks for your speedy reply.can you give me simple
> > example in slider using zoom(factor).
>
> Example:
>
> function slidertp
> load clown
> h = figure,imshow(X,map);
> h1 = uicontrol('Style','Slider','Callback',{@myzoom,h});
>
> function myzoom(obj,event,h)
> val = get(obj,'Value');
> if isempty(get(obj,'UserData'))
> val_temp = val;
> set(obj,'UserData',val_temp);
> else
> val_temp = get(obj,'UserData');
> end
> if val>=val_temp
> zoom(h,1.01);%zoom factor
> val_temp = val;
> set(obj,'UserData',val_temp);
> else
> zoom(h,0.99);%zoom factor
> val_temp = val;
> set(obj,'UserData',val_temp);
> end
>
>
> HTH
> Vihang


its working fine.In the same slider how can i make it to
zoom only horizontally by some factor?

Subject: Re: zoom

From: Vihang Patil

Date: 12 Feb, 2008 12:04:01

Message: 6 of 7

"shopana " <shopana.e@hcl.in> wrote in message <fos11i$ra5
$1@fred.mathworks.com>...
> "Vihang Patil" <vihang_patil@yahoo.com> wrote in message
> <fnn0gi$4ll$1@fred.mathworks.com>...
> > "shopana " <shopana.e@hcl.in> wrote in message
> <fnmqsi$s79
> > > thanks for your speedy reply.can you give me simple
> > > example in slider using zoom(factor).
> >
> > Example:
> >
> > function slidertp
> > load clown
> > h = figure,imshow(X,map);
> > h1 = uicontrol('Style','Slider','Callback',
{@myzoom,h});
> >
> > function myzoom(obj,event,h)
> > val = get(obj,'Value');
> > if isempty(get(obj,'UserData'))
> > val_temp = val;
> > set(obj,'UserData',val_temp);
> > else
> > val_temp = get(obj,'UserData');
> > end
> > if val>=val_temp
> > zoom(h,1.01);%zoom factor
> > val_temp = val;
> > set(obj,'UserData',val_temp);
> > else
> > zoom(h,0.99);%zoom factor
> > val_temp = val;
> > set(obj,'UserData',val_temp);
> > end
> >
> >
> > HTH
> > Vihang
>
>
> its working fine.In the same slider how can i make it to
> zoom only horizontally by some factor?


doc zoom
zoom xon
zoom yon

Vihang

Subject: Re: zoom

From: shopana

Date: 12 Feb, 2008 12:26:01

Message: 7 of 7

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fos1vh$8ng$1@fred.mathworks.com>...
> "shopana " <shopana.e@hcl.in> wrote in message
<fos11i$ra5
> $1@fred.mathworks.com>...
> > "Vihang Patil" <vihang_patil@yahoo.com> wrote in
message
> > <fnn0gi$4ll$1@fred.mathworks.com>...
> > > "shopana " <shopana.e@hcl.in> wrote in message
> > <fnmqsi$s79
> > > > thanks for your speedy reply.can you give me
simple
> > > > example in slider using zoom(factor).
> > >
> > > Example:
> > >
> > > function slidertp
> > > load clown
> > > h = figure,imshow(X,map);
> > > h1 = uicontrol('Style','Slider','Callback',
> {@myzoom,h});
> > >
> > > function myzoom(obj,event,h)
> > > val = get(obj,'Value');
> > > if isempty(get(obj,'UserData'))
> > > val_temp = val;
> > > set(obj,'UserData',val_temp);
> > > else
> > > val_temp = get(obj,'UserData');
> > > end
> > > if val>=val_temp
> > > zoom(h,1.01);%zoom factor
> > > val_temp = val;
> > > set(obj,'UserData',val_temp);
> > > else
> > > zoom(h,0.99);%zoom factor
> > > val_temp = val;
> > > set(obj,'UserData',val_temp);
> > > end
> > >
> > >
> > > HTH
> > > Vihang
> >
> >
> > its working fine.In the same slider how can i make it
to
> > zoom only horizontally by some factor?
>
>
> doc zoom
> zoom xon
> zoom yon
>
> Vihang


if i use Zoom xon,we cant make it to zoom by some factor
say(0.5x,1x,etc,..)by itself.
i ve one axes and 4 push buttons, when i click the first
button the axes will zoom(horizonally) by 0.5%,second
button 1%,third button 2%,then forth button 4%... is this
possible?

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
zoom shopana 29 Jan, 2008 03:44:55
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

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.
Related Topics