view toolboxes/FullBNT-1.0.7/KPMtools/subplot3.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
line wrap: on
line source
function fignum = subplot3(nrows, ncols, fignumBase, plotnumBase)
% function subplot3(nrows, ncols, fignumBase, plotnumBase)
% Choose a subplot number, opening a new figure if necessary
% eg nrows=2, ncols = 2, we plot on (fignum, plotnum) = (1,1), (1,2), (1,3), (1,4), (2,1), ...

nplotsPerFig = nrows*ncols;
fignum = fignumBase + div(plotnumBase-1, nplotsPerFig);
plotnum = wrap(plotnumBase, nplotsPerFig);
figure(fignum);
if plotnum==1, clf; end
subplot(nrows, ncols, plotnum);