Path: news.mathworks.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!tr22g12.aset.psu.edu!news.mathforum.org!not-for-mail
From: AMK <kennaster@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Single colorbar on figure with subplots?
Date: Mon, 13 Apr 2009 04:31:08 EDT
Organization: The Math Forum
Lines: 11
Message-ID: <12769934.31034.1239611499387.JavaMail.jakarta@nitrogen.mathforum.org>
References: <grtflc$h5u$1@fred.mathworks.com>
NNTP-Posting-Host: nitrogen.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1.mathforum.org 1239611499 25833 144.118.30.135 (13 Apr 2009 08:31:39 GMT)
X-Complaints-To: news@news.mathforum.org
NNTP-Posting-Date: Mon, 13 Apr 2009 08:31:39 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:532259


Solved.  Thanks OW and Pixel at Kluid.com for this one.

A(1)=subplot(2,1,1); mesh(x,y,z)
A(2)=subplot(2,1,2); mesh(x,y,z)
B=colorbar; 
set(B, 'Position', [.8314 .11 .0581 .8150]) 
for i=1:2 
pos=get(A(i), 'Position'); 
axes(A(i)) 
set(A(i), 'Position', [pos(1) pos(2) .6626 pos(4)]) 
end