Changeset 24882


Ignore:
Timestamp:
05/22/20 09:25:00 (5 years ago)
Author:
Eric.Larour
Message:

CHG: extended plot coastlines to 2D plots too.

File:
1 edited

Legend:

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

    r24558 r24882  
    98819881end
    98829882
    9883 [x,y,z]=AboveGround(coastlat,coastlon,mesh.r(1),1000);
    9884 hold on, p=plot3(x,y,z,'k-');
    9885 set(p,'Color',getfieldvalue(options,'coast_color','k'));
    9886 set(p,'LineWidth',getfieldvalue(options,'coast_linewidth',1));
     9883%check on the type of mesh:
     9884if strcmpi(class(mesh),'mesh2d'),
     9885        %project:
     9886        xl=getfieldvalue(options,'xlim',xlim);
     9887        yl=getfieldvalue(options,'ylim',ylim);
     9888        [x,y]=gdaltransform(coastlon,coastlat,'EPSG:4326',mesh.proj);
     9889        hold on, p=plot(x,y,'k-');
     9890        xlim(xl); ylim(yl);
     9891        set(p,'Color',getfieldvalue(options,'coast_color','k'));
     9892        set(p,'LineWidth',getfieldvalue(options,'coast_linewidth',1));
     9893else
     9894        [x,y,z]=AboveGround(coastlat,coastlon,mesh.r(1),1000);
     9895        hold on, p=plot3(x,y,z,'k-');
     9896        set(p,'Color',getfieldvalue(options,'coast_color','k'));
     9897        set(p,'LineWidth',getfieldvalue(options,'coast_linewidth',1));
     9898end
Note: See TracChangeset for help on using the changeset viewer.