Changeset 12199


Ignore:
Timestamp:
05/03/12 15:35:57 (13 years ago)
Author:
cborstad
Message:

check units before computing ticks in scaleruler

File:
1 edited

Legend:

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

    r6658 r12199  
    88structure=getfieldvalue(options,'scaleruler');
    99fontsize=getfieldvalue(options,'scaleruler_fontsize',16);
     10units=getfieldvalue(options,'unit');
    1011
    1112%Go through structure and fill missing arguments
     
    5657        yt=Bu(2)+widthscale;
    5758        if i~=numberofticks-1,
    58                 text(xt,yt,num2str(round_ice(Tick/1000,3)),'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
     59                if units==1 % m
     60                        text(xt,yt,num2str(round_ice(Tick/1000,3)),'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
     61                else
     62                        text(xt,yt,num2str(round_ice(Tick,3)),'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
     63                end
    5964        end
    6065end
    61 text(xt,yt,[num2str(round_ice(Tick/1000,3)) ' km'],'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
     66if units==1
     67        text(xt,yt,[num2str(round_ice(Tick/1000,3)) ' km'],'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
     68else
     69        text(xt,yt,[num2str(round_ice(Tick,3)) ' km'],'FontSize',fontsize,'FontWeight','n','HorizontalAlignment','left','VerticalAlignment','baseline');
     70end
Note: See TracChangeset for help on using the changeset viewer.