Changeset 2698


Ignore:
Timestamp:
12/02/09 09:23:27 (15 years ago)
Author:
Mathieu Morlighem
Message:

fixed latlon overlay so that it stays inside the image

Location:
issm/trunk/src/m/classes/public/plot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/plot/applyoptions.m

    r2693 r2698  
    4545else
    4646        view(getfieldvalue(options,'view',2));
     47end
     48
     49%latlon
     50%Must be done here so that it uses the same xlim and ylim as plot_overlay
     51%these are changed by axis that follows
     52if exist(options,'latlon')
     53        latlonoverlay(options);
    4754end
    4855
     
    184191end
    185192
    186 %latlon
    187 if exist(options,'latlon')
    188         latlonoverlay(options);
    189 end
    190 
    191193%north arrow
    192194if exist(options,'northarrow'),
  • issm/trunk/src/m/classes/public/plot/latlonoverlay.m

    r2536 r2698  
    104104                                xcorner2=x(ind-1); ycorner2=y(ind-1);
    105105                        end
    106                         angle=(180)/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner))+lonangle;
     106                        angle=mod((180)/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner))+lonangle,360);
    107107                       
    108108                        if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
     
    147147                                xcorner2=x(ind-1); ycorner2=y(ind-1);
    148148                        end
    149                         angle=(180)/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner))+latangle;
     149                        angle=mod((180)/pi*atan2((ycorner2-ycorner),(xcorner2-xcorner))+lonangle,360);
    150150                       
    151151                        if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)),
Note: See TracChangeset for help on using the changeset viewer.