Index: /issm/trunk-jpl/src/m/model/plot/plot_scatter.m
===================================================================
--- /issm/trunk-jpl/src/m/model/plot/plot_scatter.m	(revision 11160)
+++ /issm/trunk-jpl/src/m/model/plot/plot_scatter.m	(revision 11161)
@@ -1,5 +1,8 @@
 function plot_scatter(x,y,mksize,level),
 
-alreadyplot=true;
+%check input
+if numel(x)~=numel(y) | numel(x)~=numel(level),
+	error('x, y and data should have the same size');
+end
 
 %Some processing
@@ -8,4 +11,11 @@
 Siz=length(level);
 nlab=10;
+
+%OK, should we create a new colorbar for the occasion?
+if isempty(findobj(gcf,'tag','TMW_COLORBAR')),
+	alreadyplot=false;
+else
+	alreadyplot=true;
+end
 
 %generate levels
@@ -51,6 +61,6 @@
 	warning off MATLAB:log:logOfZero;
 	for i = 1:nlab
-		if abs(min(log10(abs(tick_vals)))) <= 3, fm = '%-4.0f';   % fixed
-		else                                     fm = '%-4.0E';   % floating
+		if min(log10(abs(tick_vals))) <= 3, fm = '%-4.0f';   % fixed
+		else                                fm = '%-4.0E';   % floating
 		end
 		labels{i} = sprintf(fm,tick_vals(i));
@@ -60,4 +70,4 @@
 	% set tick label strings
 	set(h,'YTickLabel',labels);
-	colorbar %one last time required sometimes
+	%colorbar %one last time required sometimes
 end
