Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Zoom / Camera Control in subplot
Date: Wed, 19 Sep 2007 12:05:04 +0000 (UTC)
Organization: Atlantic Inertial Systems
Lines: 42
Message-ID: <fcr39g$5fo$1@fred.mathworks.com>
References: <fcmth5$sis$1@fred.mathworks.com> <fcoolp$llv$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1190203504 5624 172.30.248.37 (19 Sep 2007 12:05:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 19 Sep 2007 12:05:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1091020
Xref: news.mathworks.com comp.soft-sys.matlab:429261



"Ben " <basburywvu.nospam@hotmial.com> wrote in message
<fcoolp$llv$1@fred.mathworks.com>...
> Here is an example.  When the last line is executed the
> second plot becomes to large and overlaps the top axis. 
> What I would like is for it zoom in on a region of the 3-d
> plot, keeping the axes size/position the same.  Not make the
> axes larger. The only way I have been able to make this work
> is to actually make a second figure and place it over the
> first.  There has to be a better way
> 
> % --------------
> 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,y,z] = sphere(24)
> axes(hax2);surf(x,y,z,'FaceColor',[0 0.2 0.8])
> axis vis3d
> %Now try to zoom on the sphere it takes over the plot
> camzoom(hax2,3)
> % --------------
> 
> Thanks.

Interesting.  If your data is of the form z = f(x, y) you
may have to manually clip your data.

Two dockable figures may be sufficient?

hfig = figure('WindowStyle', 'docked');
plot([0:.1:10],sin([0:.1:10]));

hfig2 = figure('WindowStyle', 'docked')
hax2 = axes;
[x,y,z] = sphere(24);
axes(hax2);surf(x,y,z,'FaceColor',[0 0.2 0.8])
axis vis3d

Clicking "Top/Bottom Tile" in the top right gives a similar
layout.

~Adam