Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Zoom / Camera Control in subplot
Date: Mon, 22 Oct 2007 10:08:30 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 40
Message-ID: <ffhsqu$h66$1@fred.mathworks.com>
References: <fcmth5$sis$1@fred.mathworks.com> <fcoolp$llv$1@fred.mathworks.com> <fcr39g$5fo$1@fred.mathworks.com> <fcrscc$jtr$1@fred.mathworks.com> <fcrttc$gtt$1@fred.mathworks.com> <fcsg0t$cgj$1@fred.mathworks.com> <fcvr2f$p15$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-06-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1193047710 17606 172.30.248.36 (22 Oct 2007 10:08:30 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 22 Oct 2007 10:08:30 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1156835
Xref: news.mathworks.com comp.soft-sys.matlab:434010



"Sonsoles Romero GarcĂ­a" <krokketilla@gmail.com> wrote in
message <fcvr2f$p15$1@fred.mathworks.com>...
> I have the same problem, but creating a new window is NOT an
> option for me. I need to zoom/explore a 3-d graph inside a
> panel of a GUI.
> A similar problem happens if the graphic is an histogram or
> a bar graphic (only when the parent of the axes is a panel
> the graphic grows all over the panel, it is interesting that
> this doesn't happen if the parent is a figure).
> 
> For example, using Ben's example:
> Zoom this is ok
> hfig = figure('Position',[200 200 800 600]);
> hax1 = axes('Position',[0.1 0.6 0.8 0.3]);
> plot([0:.1:10],sin([0:.1:10]));
> hax2 = axes('Position',[0.3 0.1 0.4 0.4]);
> x = 1:1:100; y = 100*rand(1,1000);
> axes(hax2);
> hist(y,x,'FaceColor',[0 0.2 0.8]);
> 
> But, zoom this and you'll see what happens.
> hfig = figure('Position',[200 200 800 600]);
> panel = uipanel('position',[0.05 0.05 0.9 0.9]);
> hax1 = axes('Position',[0.1 0.6 0.8 0.3],'parent',panel);
> plot([0:.1:10],sin([0:.1:10]));
> hax2 = axes('Position',[0.3 0.1 0.4 0.4],'parent',panel);
> x = 1:1:100; y = 100*rand(1,1000);
> axes(hax2);
> hist(y,x,'FaceColor',[0 0.2 0.8]);
> 
> I am using Matlab 7.1.0.246 (R14) Service Pack 3

I found a workaround on a website. Add the line:

zoom on;

after you plot the data. Now you can zoom on every plot.

Best regards,
Maarten