Changeset 14488


Ignore:
Timestamp:
03/29/13 21:15:50 (12 years ago)
Author:
cborstad
Message:

center last numerical label and then append units for scaleruler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/scaleruler.m

    r14463 r14488  
    6767                end
    6868        end
    69         text(xt,yt,2,[num2str(round_ice(Tick/1000,3)) ' km'],'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','baseline');
     69        text(xt,yt,2,num2str(round_ice(Tick/1000,3)),'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','baseline');
     70        % add leading spaces depending on length of label string
     71        str=' km';
     72        for i=1:numel(num2str(round_ice(Tick/1000,3))),
     73                str=[' ' str];
     74        end
     75        text(xt,yt,2,str,'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','left','VerticalAlignment','baseline');
    7076end
Note: See TracChangeset for help on using the changeset viewer.