Download this file
1 2 3 4 5 6
function h = subplottight(n,m,i) [c,r] = ind2sub([m n], i); ax = subplot('Position', [(c-1)/m, 1-(r)/n, 1/m, 1/n]); if(nargout > 0) h = ax; end