Global Index (short | long) | Local contents | Local Index (short | long)
sp(ncol, num);
h = sp(pos);
| This function calls | |
|---|---|
function sp(ncol, num);
global hsz vsz midv midh tmarg
if ncol == 1;
pos = [0.5 - hsz/2 ...
1 - tmarg - (num-1)*midv - num*vsz ...
hsz vsz];
elseif ncol == 2;
if mod(num, 2);
pos = [0.5 - hsz - midh/2 ...
1 - tmarg - (ceil(num/2)-1)*midv - ceil(num/2)*vsz ...
hsz vsz];
else
pos = [0.5 + midh/2 ...
1 - tmarg - (ceil(num/2)-1)*midv - ceil(num/2)*vsz ...
hsz vsz];
end
else
error('Sorry, this only works for one or two column figures');
end
subplot('position', pos);
set(gca, 'box', 'on');