Index: /issm/trunk-jpl/src/m/plot/scaleruler.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/scaleruler.m	(revision 16051)
+++ /issm/trunk-jpl/src/m/plot/scaleruler.m	(revision 16052)
@@ -10,4 +10,5 @@
 fontweight = getfieldvalue(options,'fontweight','n');
 fontsize   = getfieldvalue(options,'scaleruler_fontsize',16);
+unitscale  = getfieldvalue(options,'unit',1.);
 
 %Go through structure and fill missing arguments
@@ -17,13 +18,13 @@
 
 %retrieve scale parameters
-x0            = structure(1);
-y0            = structure(2);
-lengthscale   = structure(3);
-widthscale    = structure(4);
-numberofticks = structure(5);
+x0            = double(structure(1))/unitscale;
+y0            = double(structure(2))/unitscale;
+lengthscale   = double(structure(3))/unitscale;
+widthscale    = double(structure(4))/unitscale;
+numberofticks = double(structure(5));
 
 %If only one tick, just draw a rectangle
 if numberofticks==1,
-	text(x0+lengthscale/2,y0+2*widthscale,2,[num2str(lengthscale/1000) 'km'],...
+	text(x0+lengthscale/2,y0+2*widthscale,2,[num2str(lengthscale*unitscale/1000) ' km'],...
 		'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','baseline');
 	patch([x0 x0+lengthscale x0+lengthscale x0],[y0 y0 y0+widthscale y0+widthscale],2*ones(1,4),fontcolor,'Edgecolor',fontcolor);
@@ -48,5 +49,5 @@
 		Bu=[Au(1)+unitlength Ad(2)+widthscale];
 		Bd=[Ad(1)+unitlength Ad(2)];
-		Tick=Tick+unitlength;
+		Tick=(Tick+unitlength)*unitscale;
 
 		%pathes
