Index: /issm/branches/trunk-larour-NatClimateChange2016/src/m/plot/plot_unit.m
===================================================================
--- /issm/branches/trunk-larour-NatClimateChange2016/src/m/plot/plot_unit.m	(revision 21732)
+++ /issm/branches/trunk-larour-NatClimateChange2016/src/m/plot/plot_unit.m	(revision 21733)
@@ -30,6 +30,13 @@
 			patch( 'Faces',[C A D],'Vertices', [x y z],'CData',data(pos),'FaceColor','flat','EdgeColor',edgecolor);
 		else
-			A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
-			patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
+			A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); data=data(pos);
+			patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data,'FaceColor','flat','EdgeColor',edgecolor);
+			
+			%mask value NaN, plot white faces.
+			pos2=find(data==getfieldvalue(options,'maskvalue',NaN));
+			if ~isempty(pos2),
+				A=elements(pos(pos2),1); B=elements(pos(pos2),2); C=elements(pos(pos2),3); data=data(pos2);
+				patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceColor','w','EdgeColor',edgecolor);
+			end
 		end
 
