Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Zoom / Camera Control in subplot
Date: Fri, 21 Sep 2007 07:15:27 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <fcvr2f$p15$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>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1190358927 25637 172.30.248.35 (21 Sep 2007 07:15:27 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Sep 2007 07:15:27 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1118512
Xref: news.mathworks.com comp.soft-sys.matlab:429551



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