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.
"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
"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).
"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
"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?
"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?
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.