Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!news2.glorb.com!postnews.google.com!l16g2000yqo.googlegroups.com!not-for-mail
From: Bill  Comisky <bcomisky@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Single colorbar on figure with subplots?
Date: Fri, 13 Mar 2009 10:31:11 -0700 (PDT)
Organization: http://groups.google.com
Lines: 22
Message-ID: <a9fadb42-55fe-49bb-89ee-13cdcede6289@l16g2000yqo.googlegroups.com>
References: <f45e357b-0fbc-41e3-a6c8-e9fc6929364e@q9g2000yqc.googlegroups.com>
NNTP-Posting-Host: 208.58.200.84
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1236965471 406 127.0.0.1 (13 Mar 2009 17:31:11 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 13 Mar 2009 17:31:11 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: l16g2000yqo.googlegroups.com; posting-host=208.58.200.84; 
	posting-account=Hz1vfgoAAABxMkp5FMULOkaxa2Qwfg6n
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.7) 
	Gecko/2009030503 Fedora/3.0.7-1.fc10 Firefox/3.0.7,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:524677


On Mar 13, 10:58=A0am, agkoni...@gmail.com wrote:
> My gut tells me this should be relatively simple, but I can't figure
> it out.
>
> I have a figure with four images as subplots (2 by 2). Each has the
> same color scaling, so I would like to display all of them with a
> single colorbar along the side (or bottom) of the entire figure.
> However, the basic colorbar settings seem to force me to choose a
> single set of axes (one of the subplots) to place the colorbar near.
> Does anybody know how I might get around this?
>
> Thanks for your help!
> Alexandra

Create a new axis just for your colorbar (see axes() command) that
covers your whole figure (overlaps other axes).  Make sure you set
caxis() the same for each axis.  You can use set() on the output from
axes() to set the 'position' and 'visibility' to what you want.  You
might have to tweak the position of your other subplots to make room
if necessary.

Bill