annotate 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
rev   line source
wolffd@0 1 function fignum = subplot3(nrows, ncols, fignumBase, plotnumBase)
wolffd@0 2 % function subplot3(nrows, ncols, fignumBase, plotnumBase)
wolffd@0 3 % Choose a subplot number, opening a new figure if necessary
wolffd@0 4 % eg nrows=2, ncols = 2, we plot on (fignum, plotnum) = (1,1), (1,2), (1,3), (1,4), (2,1), ...
wolffd@0 5
wolffd@0 6 nplotsPerFig = nrows*ncols;
wolffd@0 7 fignum = fignumBase + div(plotnumBase-1, nplotsPerFig);
wolffd@0 8 plotnum = wrap(plotnumBase, nplotsPerFig);
wolffd@0 9 figure(fignum);
wolffd@0 10 if plotnum==1, clf; end
wolffd@0 11 subplot(nrows, ncols, plotnum);
wolffd@0 12
wolffd@0 13