Index: /issm/trunk/src/m/classes/public/plot/parse_options.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/parse_options.m	(revision 1877)
+++ /issm/trunk/src/m/classes/public/plot/parse_options.m	(revision 1878)
@@ -31,4 +31,12 @@
 else
 	options_struct.scaling=NaN;
+end
+
+%autoscale
+autoscalevalues=findarg(optionstring,'autoscale');
+if ~isempty(autoscalevalues),
+	options_struct.autoscale=autoscalevalues(1).value;
+else
+	options_struct.autoscale=NaN;
 end
 
Index: /issm/trunk/src/m/classes/public/plot/plot_quiver.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_quiver.m	(revision 1877)
+++ /issm/trunk/src/m/classes/public/plot/plot_quiver.m	(revision 1878)
@@ -10,4 +10,9 @@
 %      plot_quiver(md.x,md.y,md.vx,md.vy,options_structure);
 
+%keep only non NaN elements
+pos=find(~isnan(x) & ~isnan(y) & ~isnan(u) & ~isnan(v));
+x=x(pos); y=y(pos);
+u=u(pos); v=v(pos);
+
 %get norm Min and Max
 Norm=sqrt(u.^2+v.^2);
@@ -17,9 +22,7 @@
 %process options: scaling factor?
 if isnan(options_structure.scaling),
-	arrow=0.40;
+	scalingfactor=0.40;
 elseif isnumeric(options_structure.scaling),
-	arrow=options_structure.scaling;
-elseif ischar(options_structure.scaling) & strcmpi(options_structure.scaling,'off'),
-	arrow=NaN;
+	scalingfactor=options_structure.scaling;
 else
 	error('plot_quiver error message: scaling option other than scalaer or ''off'' not supported yet')
@@ -58,8 +61,12 @@
 
 %Scale data
-if ~isnan(arrow),
+if ~isnan(options_structure.autoscale) & strcmpi(options_structure.autoscale,'off'),
 	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
-	u=arrow*sqrt(delta)*u./Norm;
-	v=arrow*sqrt(delta)*v./Norm;
+	u=scalingfactor*sqrt(delta)*u./Norm;
+	v=scalingfactor*sqrt(delta)*v./Norm;
+else
+	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
+	u=scalingfactor*sqrt(delta)*u./max(Norm);
+	v=scalingfactor*sqrt(delta)*v./max(Norm);
 end
 
Index: /issm/trunk/src/m/classes/public/plot/plot_quiver3.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_quiver3.m	(revision 1877)
+++ /issm/trunk/src/m/classes/public/plot/plot_quiver3.m	(revision 1878)
@@ -10,4 +10,9 @@
 %      plot_quiver(md.x,md.y,md.z,md.vx,md.vy,md.vz,options_structure);
 
+%keep only non NaN elements
+pos=find(~isnan(x) & ~isnan(y) & ~isnan(z) & ~isnan(u) & ~isnan(v) & ~isnan(w));
+x=x(pos); y=y(pos); z=z(pos);
+u=u(pos); v=v(pos); w=w(pos);
+
 %get norm Min and Max
 Norm=sqrt(u.^2+v.^2+w.^2);
@@ -17,7 +22,9 @@
 %process options: scaling factor?
 if isnan(options_structure.scaling),
-	arrow=0.40;
+	scalingfactor=0.40;
+elseif isnumeric(options_structure.scaling),
+	scalingfactor=options_structure.scaling;
 else
-	arrow=options_structure.scaling;
+	error('plot_quiver error message: scaling option other than scalaer or ''off'' not supported yet')
 end
 
@@ -54,8 +61,13 @@
 
 %Scale data
-delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
-u=arrow*sqrt(delta)*u./Norm;
-v=arrow*sqrt(delta)*v./Norm;
-w=arrow*sqrt(delta)*w./Norm;
+if ~isnan(options_structure.autoscale) & strcmpi(options_structure.autoscale,'off'),
+	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
+	u=scalingfactor*sqrt(delta)*u./Norm;
+	v=scalingfactor*sqrt(delta)*v./Norm;
+else
+	delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x);
+	u=scalingfactor*sqrt(delta)*u./max(Norm);
+	v=scalingfactor*sqrt(delta)*v./max(Norm);
+end
 
 %loop over the number of colors
@@ -69,10 +81,33 @@
 
 %take care of colorbar
-if  0 & ~strcmpi(options_structure.colorbar,'off'),
+if  ~strcmpi(options_structure.colorbar,'off'),
+
+	%build ticks
+	hcb=colorbar('peer',gca,'location','EastOutside');
+	ticklabel=cell(1,length(levels));
 	for i=1:length(levels),
-		scalevalues(i)=levels(i);
-		scalestring=[scalestring; sprintf('%8.4g',levels(i))];
+		ticklabel{i}=num2str(round_ice(levels(i),3));
 	end
-	set(colorbar,'YTickLabel',scalestring,'YTick',scalevalues);
-	error('debug')
+	tickpos=1:numcolors+1;
+
+	%remove ticks if to many have been created
+	proportion=round(length(levels)/10);
+	if proportion>1,
+		ticklabel=ticklabel(1:proportion:end);
+		tickpos=tickpos(1:proportion:end);
+	end
+
+	%draw colorbar
+	set(hcb,'YTickLabel',ticklabel,'YTick',tickpos);
+	%position
+	if ~isnan(options_structure.colorbarpos),
+		set(hcb,'Position',options_structure.colorbarpos);
+	end
+	%fontsize
+	if ~isnan(options_structure.fontsize),
+		fontsize=options_structure.fontsize;
+	else
+		fontsize=14;
+	end
+	set(hcb,'FontSize',fontsize);
 end
Index: /issm/trunk/src/m/classes/public/plot/plotdoc.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plotdoc.m	(revision 1877)
+++ /issm/trunk/src/m/classes/public/plot/plotdoc.m	(revision 1878)
@@ -83,4 +83,5 @@
 disp('       ''alpha'': transparency coefficient (the higher, the more transparent). Default is 1.5');
 disp('       ''scaling'': scaling factor used by quiver plots. Default is 0.4');
+disp('       ''autoscale'': set to ''off'' to have all the quivers with the same size. Default is ''on''');
 disp('       ''expdisp'': plot exp file on top of a data plot. provide exp file as an argument (use a cell of strings if more than one)');
 disp('       ''expstyle'': marker style for expdisp plot (use a cell of strings if more than one)');
