Documentation of subplot2


Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)


Function Synopsis

this_ax = subplot2(ncol, num);

Help text


  this_ax = subplot2(nCol, thisPlot);

  nCol = number of columns to be produced
  thisPlot = the subplot number (standard order)

  This routine produces subplots sized and positioned
  according to the dimensions specified by global_axes.
  This is helpful for producing actual-sized figures 
  (e.g., for publications).

  See also:  global_axes, subplot


Cross-Reference Information

This function calls This function is called by

Listing of function subplot2

function this_ax = subplot2(ncol, num);

global HSZ VSZ MIDV MIDH TMARG 

pos = [0.5 - (ncol/2)*HSZ - (ncol-1)*MIDH/2 + ...
       mod(num-1,ncol)*(HSZ+MIDH) ... 
       1 - TMARG - (ceil(num/ncol)-1)*MIDV - ceil(num/ncol)*VSZ ...
       HSZ VSZ]; 

if isreal(sqrt([pos(1:2) pos(1:2)+pos(3:4)]));
  subplot('position', pos);
  set(gca, 'box', 'on');
else
  er = ['The subplot is outside the figure limits.'];
  error(er);
end

if nargout == 1;
    this_ax = gca;
end