Index: /issm/trunk/src/m/model/plot/plot_section.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_section.m	(revision 6630)
+++ /issm/trunk/src/m/model/plot/plot_section.m	(revision 6631)
@@ -3,5 +3,5 @@
 %
 %   Usage:
-%      plot_section(md,options,width,i);
+%      plot_section(md,data,options,nlines,ncols,i)
 %
 %   See also: PLOTMODEL
@@ -11,9 +11,9 @@
 
 	%Compute the indexes of the 2 plots (one for the sectionvalue and one for showsection
-	upperplots=fix((i-1)/width);
-	if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
-	index1=4*width*upperplots+2*leftplots+1;
+	upperplots=floor((i-1)/ncols);
+	if upperplots==0, leftplots=i-1; else leftplots=i-ncols*upperplots-1; end
+	index1=4*ncols*upperplots+2*leftplots+1;
 	index2=index1+1;
-	width=2*width;
+	ncols=2*ncols;
 else
 	index1=i;
@@ -78,5 +78,5 @@
 
 			%plot section only with labels
-			subplot(width,width,index2)
+			subplot(nlines,ncols,index2)
 			plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,datatype,options)
 			hold on
@@ -126,5 +126,5 @@
 
 				%plot section only with labels
-				subplot(width,width,index2)
+				subplot(nlines,ncols,index2)
 				plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,datatype,options)
 				hold on
@@ -139,5 +139,5 @@
 			end
 
-			subplot(width,width,index1)
+			subplot(nlines,ncols,index1)
 			A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4); 
 			patch( 'Faces', [A B C D], 'Vertices', [s z zeros(length(s),1)],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none');
@@ -161,5 +161,5 @@
 
 				%plot section only with labels
-				subplot(width,width,index2)
+				subplot(nlines,ncols,index2)
 				plot_unit(x_m,y_m,z_m,elements_m,data,is2d,datatype,options)
 				hold on
@@ -174,5 +174,5 @@
 			end
 
-			subplot(width,width,index1)
+			subplot(nlines,ncols,index1)
 			A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4); 
 			patch( 'Faces', [A B C D], 'Vertices', [x y z],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none');
