Index: /issm/trunk-jpl/src/m/plot/plotmodel.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plotmodel.m	(revision 22906)
+++ /issm/trunk-jpl/src/m/plot/plotmodel.m	(revision 22907)
@@ -5,22 +5,20 @@
 options=plotoptions(varargin{:});
 
-%get number of subplots
-subplotwidth=ceil(sqrt(options.numberofplots));
-
 %Get figure number and number of plots
 figurenumber=options.figurenumber;
 numberofplots=options.numberofplots;
 
+%get number of subplots
+subplotwidth=ceil(sqrt(options.numberofplots));
+
 %if nlines and ncols specified, then bypass.
-if exist(options.list{1},'nlines'),
-	nlines=getfieldvalue(options.list{1},'nlines');
-else 
-	nlines=ceil(numberofplots/subplotwidth);
-end
-
-if exist(options.list{1},'ncols'),
-	ncols=getfieldvalue(options.list{1},'ncols');
-else 
-	ncols=subplotwidth;
+if ~exist(options.list{1},'nlines') & ~exist(options.list{1},'ncols')
+	 nlines=ceil(numberofplots/subplotwidth);
+	 ncols=subplotwidth;
+else
+	nlines=getfieldvalue(options.list{1},'nlines',NaN);
+	ncols=getfieldvalue(options.list{1},'ncols',NaN);
+	if isnan(nlines), nlines = ceil(numberofplots/ncols);  end
+	if isnan(ncols),  ncols  = ceil(numberofplots/nlines); end
 end
 
