Index: /issm/trunk/src/m/classes/public/plot/plot_manager.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_manager.m	(revision 1109)
+++ /issm/trunk/src/m/classes/public/plot/plot_manager.m	(revision 1110)
@@ -84,4 +84,7 @@
 			plot_segmentonneumann(md,options_structure,width,i,data)
 			return
+		case 'segments'
+			plot_segments(md,options_structure,width,i,data)
+			return
 		case {'strainrate_tensor','strainrate','strainrate_principal','strainrate_principalaxis1','strainrate_principalaxis2','strainrate_principalaxis3',...
 				'stress_tensor','stress','stress_principal','stress_principalaxis1','stress_principalaxis2','stress_principalaxis3',...
Index: /issm/trunk/src/m/classes/public/plot/plot_qmuimportancefactors.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_qmuimportancefactors.m	(revision 1109)
+++ /issm/trunk/src/m/classes/public/plot/plot_qmuimportancefactors.m	(revision 1110)
@@ -35,5 +35,5 @@
 end
 responsefunctions=responsefunctions(found);
-nfun=size(responsefunctions.desvar,1);
+nfun=size(responsefunctions.var,1);
 
 %Now recover response to the correct design variable
@@ -41,6 +41,6 @@
 count=0;
 for i=1:nfun,
-	desvar=responsefunctions.desvar{i};
-	if strncmpi(desvar,descriptor,descriptorlength),
+	var=responsefunctions.var{i};
+	if strncmpi(var,descriptor,descriptorlength),
 		count=count+1;
 		importancefactors(count)=responsefunctions.impfac(i);
Index: /issm/trunk/src/m/classes/public/plot/plot_segments.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_segments.m	(revision 1110)
+++ /issm/trunk/src/m/classes/public/plot/plot_segments.m	(revision 1110)
@@ -0,0 +1,52 @@
+function plot_segments(md,options_structure,width,i,datai);
+%PLOT_SEGMENTS - plot segments, with different colors according to segment markers.
+%
+%   Usage:
+%      plot_segments(md,options_structure,width,i);
+%
+%   See also: PLOTMODEL
+
+%plot mesh boundaries
+subplot(width,width,i); 
+
+%units
+if ~isnan(options_structure.unitmultiplier),
+	md.x=md.x*options_structure.unitmultiplier;
+	md.y=md.y*options_structure.unitmultiplier;
+	md.z=md.z*options_structure.unitmultiplier;
+end
+
+segments=md.segments;
+
+length=sqrt( (md.x(segments(:,1))-md.x(segments(:,2))).^2 + (md.y(segments(:,1))-md.y(segments(:,2))).^2 );
+%normal(:,1)=cos(atan2( (md.x(segments(:,1))-md.x(segments(:,2))) , (md.y(segments(:,2))-md.y(segments(:,1))) ) );
+%normal(:,2)=sin(atan2( (md.x(segments(:,1))-md.x(segments(:,2))) , (md.y(segments(:,2))-md.y(segments(:,1))) ) );
+
+if strcmpi(md.type,'2d'),
+	for n=1:size(segments,1),
+
+		plot(md.x(segments(n,1:2)),md.y(segments(n,1:2)),'b-','linewidth',2);
+		hold on
+		plot(md.x(segments(n,1:2)),md.y(segments(n,1:2)),'r.','markersize',12);
+
+		%xstart=mean(md.x(segments(n,1:2)));
+		%ystart=mean(md.y(segments(n,1:2)));
+
+		%xend=xstart+length(n)*normal(n,1);
+		%yend=ystart+length(n)*normal(n,2);
+
+		%plot([xstart xend],[ystart yend],'r-')
+		legend('element edges on ice front','grids on ice front','normal vectors')
+	end
+else
+	error('plot_segments: 3d plot of segments not supported yet!');
+end
+
+%apply options
+if isnan(options_structure.title)
+	options_structure.title='Segment boundaries';
+end 
+if isnan(options_structure.colorbar)
+	options_structure.colorbar=0;
+end
+applyoptions(md,[],options_structure);
