Changeset 16052
- Timestamp:
- 09/03/13 08:56:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/scaleruler.m
r14488 r16052 10 10 fontweight = getfieldvalue(options,'fontweight','n'); 11 11 fontsize = getfieldvalue(options,'scaleruler_fontsize',16); 12 unitscale = getfieldvalue(options,'unit',1.); 12 13 13 14 %Go through structure and fill missing arguments … … 17 18 18 19 %retrieve scale parameters 19 x0 = structure(1);20 y0 = structure(2);21 lengthscale = structure(3);22 widthscale = structure(4);23 numberofticks = structure(5);20 x0 = double(structure(1))/unitscale; 21 y0 = double(structure(2))/unitscale; 22 lengthscale = double(structure(3))/unitscale; 23 widthscale = double(structure(4))/unitscale; 24 numberofticks = double(structure(5)); 24 25 25 26 %If only one tick, just draw a rectangle 26 27 if numberofticks==1, 27 text(x0+lengthscale/2,y0+2*widthscale,2,[num2str(lengthscale /1000) 'km'],...28 text(x0+lengthscale/2,y0+2*widthscale,2,[num2str(lengthscale*unitscale/1000) ' km'],... 28 29 'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','baseline'); 29 30 patch([x0 x0+lengthscale x0+lengthscale x0],[y0 y0 y0+widthscale y0+widthscale],2*ones(1,4),fontcolor,'Edgecolor',fontcolor); … … 48 49 Bu=[Au(1)+unitlength Ad(2)+widthscale]; 49 50 Bd=[Ad(1)+unitlength Ad(2)]; 50 Tick= Tick+unitlength;51 Tick=(Tick+unitlength)*unitscale; 51 52 52 53 %pathes
Note:
See TracChangeset
for help on using the changeset viewer.