Changeset 7142


Ignore:
Timestamp:
01/23/11 11:39:42 (14 years ago)
Author:
Eric.Larour
Message:

Added new showbasins and modified call to basinzoom

File:
1 edited

Legend:

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

    r7055 r7142  
    8989%Basinzoom
    9090if exist(options,'basin');
    91         basinzoom(getfieldvalue(options,'basin'),getfieldvalue(options,'unit',1));
    92 end
     91        if strcmpi(md.hemisphere,'n'), hemisphere=+1; else hemisphere=-1; end
     92        basinzoom('basin',getfieldvalue(options,'basin'),'hemisphere',getfieldvalue(options,'hemisphere',hemisphere),'basindeltax',getfieldvalue(options,'basindeltax',300000),'basindeltay',getfieldvalue(options,'basindeltay',300000),'unit',getfieldvalue(options,'unit',1));
     93end
     94
     95%ShowBasins
     96if strcmpi(getfieldvalue(options,'showbasins','off'),'on')
     97        if strcmpi(md.hemisphere,'n'), hemisphere=+1; else hemisphere=-1; end
     98        showbasins('hemisphere',getfieldvalue(options,'hemisphere',hemisphere),'fontsize',fontsize);
     99end
     100
    93101
    94102%Caxis
     
    202210        end
    203211        if exist(options,'colorbartitle'),
    204                 set(get(c,'title'),'String',getfieldvalue(options,'colorbartitle'),'Color',getfieldvalue(options,'FontColor','k'));
     212                set(get(c,'title'),'FontSize',getfieldvalue(options,'colorbarfontsize',fontsize),'String',getfieldvalue(options,'colorbartitle'),'Color',getfieldvalue(options,'FontColor','k'));
    205213        end
    206214        if exist(options,'colorbarwidth'),
     
    356364        %if we are zooming on a basin, don't take the mesh for the boundaries!
    357365        if exist(options,'basin'),
    358                 [mdx mdy]=basinzoom(getfieldvalue(options,'basin'));
    359         else
    360                 mdx=[min(md.x) max(md.x)];
    361                 mdy=[min(md.y) max(md.y)];
    362         end
    363         line(A.x,A.y,'color','b');
    364         patch([Ax(1)  Ax(2)  Ax(2)  Ax(1) Ax(1)],[Ay(1)  Ay(1)  Ay(2)  Ay(2) Ay(1)],[1 1 1],'EdgeColor',[0 0 0],'LineWidth',1,'FaceLighting','none')
    365         patch( [mdx(1) mdx(2) mdx(2) mdx(1)],[mdy(1) mdy(1) mdy(2) mdy(2)],ones(4,1),'EdgeColor',[0 0 0],'FaceColor','r','FaceAlpha',0.5)
    366         colorbar('off');
     366                if strcmpi(md.hemisphere,'n'), hemisphere=+1; else hemisphere=-1; end
     367                [mdx mdy]=basinzoom('basin',getfieldvalue(options,'basin'),'hemisphere',getfieldvalue(options,'hemisphere',hemisphere),'basindeltax',getfieldvalue(options,'basindeltax',300000),'basindeltay',getfieldvalue(options,'basindeltay',300000),'unit',getfieldvalue(options,'unit',1));
     368else
     369        mdx=[min(md.x) max(md.x)];
     370        mdy=[min(md.y) max(md.y)];
     371end
     372line(A.x,A.y,'color','b');
     373patch([Ax(1)  Ax(2)  Ax(2)  Ax(1) Ax(1)],[Ay(1)  Ay(1)  Ay(2)  Ay(2) Ay(1)],[1 1 1],'EdgeColor',[0 0 0],'LineWidth',1,'FaceLighting','none')
     374patch( [mdx(1) mdx(2) mdx(2) mdx(1)],[mdy(1) mdy(1) mdy(2) mdy(2)],ones(4,1),'EdgeColor',[0 0 0],'FaceColor','r','FaceAlpha',0.5)
     375colorbar('off');
    367376end
    368377
    369378%flag edges of a partition
    370379if exist(options,'partitionedges')
    371         [xsegments ysegments]=flagedges(md.elements,md.x,md.y,md.part);
    372         xsegments=xsegments*getfieldvalue(options,'unit',1);
    373         ysegments=ysegments*getfieldvalue(options,'unit',1);
    374         color=getfieldvalue(options,'partitionedgescolor','r-');
    375         linewidth=getfieldvalue(options,'linewidth',1);
    376         hold on;
    377         for i=1:length(xsegments),
    378                 plot(xsegments(i,:),ysegments(i,:),color,'LineWidth',linewidth);
    379         end
     380[xsegments ysegments]=flagedges(md.elements,md.x,md.y,md.part);
     381xsegments=xsegments*getfieldvalue(options,'unit',1);
     382ysegments=ysegments*getfieldvalue(options,'unit',1);
     383color=getfieldvalue(options,'partitionedgescolor','r-');
     384linewidth=getfieldvalue(options,'linewidth',1);
     385hold on;
     386for i=1:length(xsegments),
     387        plot(xsegments(i,:),ysegments(i,:),color,'LineWidth',linewidth);
     388end
    380389end
    381390
Note: See TracChangeset for help on using the changeset viewer.