Changeset 3103


Ignore:
Timestamp:
02/23/10 16:27:41 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added nice colors

File:
1 edited

Legend:

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

    r3099 r3103  
    2121        hold on;
    2222
    23         %highlight elements on neumann in Green
    24         pos=pressureload(:,end-1);
     23        %highlight elements on neumann
     24        pos=find(pressureload(:,end)==WaterEnum());
     25        pos=pressureload(pos,end-1);
    2526        A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    26         h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
    27         hold on;
     27        h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
     28        pos=find(pressureload(:,end)==AirEnum());
     29        pos=pressureload(pos,end-1);
     30        A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
     31        h3=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
    2832
    2933        %display arrows pointing outward
     
    3640        yend=ystart+length.*normal(:,2);
    3741        q=quiver(xstart,ystart,xend-xstart,yend-ystart); hold on;
    38         h3=plot(xstart,ystart,'r*');
     42        h4=plot(xstart,ystart,'r*');
    3943else
    4044
     
    4852        hold on;
    4953
    50         %highlight elements on neumann in Green
    51         pos=pressureload(:,end-1);
     54        %highlight elements on neumann
     55        pos=find(pressureload(:,end)==WaterEnum());
     56        pos=pressureload(pos,end-1);
    5257        A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    53         h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
     58        h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
     59        patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
     60        patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
     61        patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
     62        patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
     63        pos=find(pressureload(:,end)==AirEnum());
     64        pos=pressureload(pos,end-1);
     65        A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
     66        h3=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
    5467        patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
    5568        patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
    5669        patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
    5770        patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
    58         hold on;
    5971
    6072        %display arrows pointing outward
     
    7385%legend (disable warnings)
    7486warning off
    75 legend([h2,q],'element on ice front','normal vectors')
     87legend([h2,h3,q],'element on ice front (Water)','element on ice front (Air)','normal vectors')
    7688warning on
    7789
Note: See TracChangeset for help on using the changeset viewer.