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

Jakob

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Jakob
Updated File Comments Rating
21 May 2013 Subaxis - Subplot Use HTML jargon for multi axis layout. Author: Aslak Grinsted

I slightly modified Matthias code below to make it work for an arbitrary long horizontal subregion subplot(m,n,x:y), e.g. subplot(2,3,1:3) or subplot(3,3,4:9):

if numel(Args.NumericArguments{1}) == 2 % restore subplot(m,n,[x y]) behaviour
[x1 y1] = ind2sub([Args.cols Args.rows],Args.NumericArguments{1}(1)); % subplot and ind2sub count differently (column instead of row first) --> switch cols/rows
[x2 y2] = ind2sub([Args.cols Args.rows],Args.NumericArguments{1}(end));
else
x1=mod((Args.NumericArguments{1}-1),Args.cols)+1; x2=x1;
y1=floor((Args.NumericArguments{1}-1)/Args.cols)+1; y2=y1;
end

Contact us