Index: /issm/trunk-jpl/src/m/plot/plotmodel.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/plotmodel.m	(revision 14400)
+++ /issm/trunk-jpl/src/m/plot/plotmodel.m	(revision 14401)
@@ -8,9 +8,13 @@
 subplotwidth=ceil(sqrt(options.numberofplots));
 
+%Get figure number and number of plots
+figurenumber=options.figurenumber;
+numberofplots=options.numberofplots;
+
 %if nlines and ncols specified, then bypass.
 if exist(options.list{1},'nlines'),
 	nlines=getfieldvalue(options.list{1},'nlines');
 else 
-	nlines=subplotwidth;
+	nlines=ceil(numberofplots/subplotwidth);
 end
 
@@ -25,8 +29,4 @@
 	error('plotmodel error message: nlines and ncols  need to be specified together, or not at all');
 end
-
-%Get figure number and number of plots
-figurenumber=options.figurenumber;
-numberofplots=options.numberofplots;
 
 %go through subplots
