Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Single colorbar on figure with subplots?
Date: Sun, 12 Apr 2009 12:50:01 +0000 (UTC)
Organization: Oxford University
Lines: 36
Message-ID: <grso1p$mi5$1@fred.mathworks.com>
References: <f45e357b-0fbc-41e3-a6c8-e9fc6929364e@q9g2000yqc.googlegroups.com> <a9fadb42-55fe-49bb-89ee-13cdcede6289@l16g2000yqo.googlegroups.com> <grs59r$9t2$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 1239540601 23109 172.30.248.37 (12 Apr 2009 12:50:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 12 Apr 2009 12:50:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1073021
Xref: news.mathworks.com comp.soft-sys.matlab:532131


"Adam " <kennaster@gmail.com> wrote:
> Given this simple but working script, could you provide a practical example of what you mean?  I couldn't find an actual working example anywhere online.
> 
> % begin plotting routine
> close all
> figure('Color',[1 1 1]);
> x1 = 0:12:288;
> x2 = 0:15:285;
> % define the timesteps of interest
> y1 = 1.5:0.044:36.5; % define the y-axis (height in this case)
> y2 = [1.5,3.,5.,7.,10.,15.,20.,25.,30.,33.,37.];
> [x1,y1] = meshgrid(x1,y1);  % build the plot matrix
> [x2,y2] = meshgrid(x2,y2);  % build the plot matrix
> z1 = data_clip(:,114:138);  % span of interest
> z3 = towerProfile(:,98:117);  % select the data to plot
> rotate3d
> subplot(2,1,1); pcolor(x1,y1,z1)
> view([0.5 90]);
> shading interp
> colormap(jet)
> grid off
> % Create colorbar
> %c=colorbar ('FontSize',18);
> %ylabel(c,'Degrees C')
> subplot(2,1,2); pcolor(x2,y2,z3)
> axis tight
> view([0.5 90]);
> shading interp
> colormap(jet)          
> grid off 
> % Create colorbar
axes('Position', [0.05 0.05 0.9 0.9], 'Visible', 'off');
> c=colorbar ('FontSize',18);
> ylabel(c,'Degrees C')

See inline edits.