Changeset 12307


Ignore:
Timestamp:
05/31/12 13:22:23 (13 years ago)
Author:
Mathieu Morlighem
Message:

Added plot_scatter as an option to plotmodel and fixed showregion

File:
1 edited

Legend:

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

    r12166 r12307  
    292292                textpositioni=textposition{i};
    293293                textrotationi=textrotation{i};
    294                 h=text(textpositioni(1),textpositioni(2),textstringi,'FontSize',textsizei,'FontWeight',textweighti,'Color',textcolori,'Rotation',textrotationi);
     294                h=text(textpositioni(1),textpositioni(2),10,textstringi,'FontSize',textsizei,'FontWeight',textweighti,'Color',textcolori,'Rotation',textrotationi);
    295295                set(h,'Clipping','on'); %prevent text from appearing outside of the box
    296296        end
     
    349349if exist(options,'axispos'),
    350350        Axis=getfieldvalue(options,'axispos');
     351        hold on
    351352        set(gca,'pos',Axis);
    352353end
     
    414415        %box off
    415416        if strcmpi(md.mesh.hemisphere,'n') | strcmpi(md.mesh.hemisphere,'north'),
    416                 A=expread([ issmdir() '/projects/Exp/GreenlandBoxFront.exp']);
     417                A=expread([ jplsvn() '/projects/Exp/GreenlandBoxFront.exp']);
    417418                [A.x A.y]=ll2xy(A.x,A.y,+1,45,70);
     419                A.x = A.x(1:30:end);
     420                A.y = A.y(1:30:end);
    418421        elseif strcmpi(md.mesh.hemisphere,'s') | strcmpi(md.mesh.hemisphere,'south'),
    419                 A=expread([ issmdir() '/projects/Exp/Antarctica.exp']);
     422                A=expread([ jplsvn() '/projects/Exp/Antarctica.exp']);
    420423        else
    421424                error('applyoptions error message: hemisphere not defined');
    422425        end
    423         Ax=[min(A.x) max(A.x)];
    424         Ay=[min(A.y) max(A.y)];
     426        offset=3*10^4;
     427        Ax=[min(A.x)-offset max(A.x)+offset];
     428        Ay=[min(A.y)-offset max(A.y)+offset];
    425429        %if we are zooming on a basin, don't take the mesh for the boundaries!
    426430        if exist(options,'basin'),
    427431                [mdx mdy]=basinzoom(options);
    428432        else
    429                 offset=3*10^4;
    430433                mdx=[min(md.mesh.x)-offset max(md.mesh.x)+offset];
    431434                mdy=[min(md.mesh.y)-offset max(md.mesh.y)+offset];
     
    433436        line(A.x,A.y,ones(size(A.x)),'color','b');
    434437        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')
    435         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)
     438        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)
    436439        colorbar('off');
    437440        %back to main gca
     
    441444%flag edges of a partition
    442445if exist(options,'partitionedges')
    443 [xsegments ysegments]=flagedges(md.mesh.elements,md.mesh.x,md.mesh.y,md.qmu.partition);
    444 xsegments=xsegments*getfieldvalue(options,'unit',1);
    445 ysegments=ysegments*getfieldvalue(options,'unit',1);
    446 color=getfieldvalue(options,'partitionedgescolor','r-');
    447 linewidth=getfieldvalue(options,'linewidth',1);
    448 hold on;
    449 for i=1:length(xsegments),
    450         plot(xsegments(i,:),ysegments(i,:),color,'LineWidth',linewidth);
    451 end
     446        [xsegments ysegments]=flagedges(md.mesh.elements,md.mesh.x,md.mesh.y,md.qmu.partition);
     447        xsegments=xsegments*getfieldvalue(options,'unit',1);
     448        ysegments=ysegments*getfieldvalue(options,'unit',1);
     449        color=getfieldvalue(options,'partitionedgescolor','r-');
     450        linewidth=getfieldvalue(options,'linewidth',1);
     451        hold on;
     452        for i=1:length(xsegments),
     453                plot(xsegments(i,:),ysegments(i,:),color,'LineWidth',linewidth);
     454        end
     455end
     456
     457%Scatter
     458if exist(options,'scatter')
     459        data=getfieldvalue(options,'scatter');
     460        hold on
     461        plot_scatter(data(:,1),data(:,2),getfieldvalue(options,'scattersize',3),data(:,3));
    452462end
    453463
Note: See TracChangeset for help on using the changeset viewer.