Rank: 71221 based on 0 downloads (last 30 days) and 0 file submitted
photo

Ka Ru

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Ka
Updated File Comments Rating
01 Feb 2013 Subaxis - Subplot Use HTML jargon for multi axis layout. Author: Aslak Grinsted

Thanks a lot for this great file
Some of you mentioned, that they would like to generate, subplots of the form
subaxis(2,2,1:2). Here a small example
how it can be done:
---------------------------
% Generate figure with three subplots
%
% |-plot1-| |-plot2-|
% |------plot3------|
% Define functions
t=0:0.05:20;
y1=sin(pi*t);
y2=cos(pi*t);
y3=y1.*exp(-0.1*t);
%Define spacings
spaceH=0.03;spaceV=0.15;marTop=0.08;marBot=0.1;
padding=0.025;margin=0.02;marginL=0.03;

% Generate plot
fig=figure(1);

subaxis(2,2,1,'SpacingHoriz', spaceH,
'SpacingVert',spaceV, 'PL',padding,'PR',padding,'mt',...
marTop,'mb',marBot,'ML',marginL,'MR',margin);
plot(t,y1);
title('Sin'); xlabel('t [s]');

subaxis(2,2,2,'SpacingHoriz', spaceH,
'SpacingVert',spaceV, 'PL',padding,'PR',padding,'mt',...
marTop,'mb',marBot,'ML',marginL,'MR',margin);
plot(t,y2);
title('Cos');xlabel('t [s]');

sub=subaxis(2,2,3,'SpacingHoriz', spaceH, 'SpacingVert',spaceV, 'PL',padding,'PR',padding,'mt',...
marTop,'mb',marBot,'ML',marginL,'MR',margin);
%change with of the third subplot
pos=get(sub,'position');
set(sub,'Position',[pos(1) pos(2) pos(3)*2.2 pos(4)],'color', [1 1 1]);
plot(t,y3);
title('Exp');xlabel('t [s]');
-------------------------------

Contact us