Changeset 2695


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

lots of good modifs of rift plots

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

Legend:

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

    r2439 r2695  
    11function plot_riftfraction(md,options,width,i);
    2 %PLOT_RIFTRELVEL - plot rift fractions
     2%PLOT_RIFTFRACTION - plot rift fractions
    33%
    44%   Usage:
     
    77%   See also: PLOTMODEL
    88
     9%process data and model
     10[x y z elements is2d]=processmesh(md,options);
     11
     12subplot(width,width,i);
     13hold on
     14
    915%plot mesh boundaries
    10 subplot(width,width,i);
    11 
    12 %units
    13 if exist(options,'unit'),
    14         unit=getfieldvalue(options,'unit');
    15         md.x=md.x*unit;
    16         md.y=md.y*unit;
    17         md.z=md.z*unit;
    18 end
    19 
    2016for i=1:size(md.segments,1),
    21         h1=plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'k.-');hold on;
     17        h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-');
    2218end
    2319
     
    3834for i=1:length(md.rifts),
    3935        segments=md.rifts(i).segments(:,1:2)';
    40         xc=md.x(segments(:));
    41         yc=md.y(segments(:));
     36        xc=x(segments(:));
     37        yc=y(segments(:));
    4238        zc=fractions(segments(:));
    4339        h2=patch('Xdata',xc,'Ydata',yc,'Zdata',zc,'Cdata',zc,'facecolor','none','edgecolor','flat');
    4440end
    4541legend([h1,h2],'mesh boundaries','rifts')
     42hold off
    4643
    4744%apply options
    48 options=addfielddefault(options,'title','Rift relative velocities');
     45options=addfielddefault(options,'title','Rift ice/water fraction ???????'); %Eric, could you enter a better title?
    4946options=addfielddefault(options,'colorbar',0);
    5047applyoptions(md,[],options);
  • issm/trunk/src/m/classes/public/plot/plot_riftpenetration.m

    r2439 r2695  
    77%   See also: PLOTMODEL
    88
     9%process data and model
     10[x y z elements is2d]=processmesh(md,options);
     11
     12subplot(width,width,i);
     13hold on
     14
    915%plot mesh boundaries
    10 subplot(width,width,i);
    11 
    12 %units
    13 if exist(options,'unit'),
    14         unit=getfieldvalue(options,'unit');
    15         md.x=md.x*unit;
    16         md.y=md.y*unit;
    17         md.z=md.z*unit;
     16for i=1:size(md.segments,1),
     17        plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-');
    1818end
    19 
    20 for i=1:size(md.segments,1),
    21         plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'k.-');hold on;
    22 end
    23 
    24 hold on;
    2519
    2620isp1=0;
     
    3024        %plot mesh boundaries
    3125        for i=1:size(md.segments,1),
    32                 h1=plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'b-');
     26                h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'b-');
    3327        end
    3428        for i=1:size(md.rifts,1),
     
    3731                segments=md.rifts(i).segments;
    3832                for j=1:size(segments,1),
    39                         plot(md.x(segments(j,1:2)),md.y(segments(j,1:2)),'b-');
     33                        plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
    4034                end
    4135
     
    5246                        %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
    5347                        if(penetration>0),
    54                                 p2=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'r*');
     48                                p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'r*');
    5549                                isp2=1;
    5650                        else
    57                                 p1=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'k*');
     51                                p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k*');
    5852                                isp1=1;
    5953                        end
     
    6155
    6256                %point out the tips
    63                 h2=plot(md.x(md.rifts(i).tips(1)),md.y(md.rifts(i).tips(1)),'g*');
    64                 plot(md.x(md.rifts(i).tips(2)),md.y(md.rifts(i).tips(2)),'g*');
     57                h2=plot(x(md.rifts(i).tips(1)),y(md.rifts(i).tips(1)),'g*');
     58                plot(x(md.rifts(i).tips(2)),y(md.rifts(i).tips(2)),'g*');
    6559        end
    6660        if isp1 & isp2
     
    7670        error('plot error message: no rifts available!');
    7771end
     72hold off
    7873
    7974%apply options
  • issm/trunk/src/m/classes/public/plot/plot_riftrelvel.m

    r2439 r2695  
    77%   See also: PLOTMODEL
    88
     9%process data and model
     10[x y z elements is2d]=processmesh(md,options);
     11
     12subplot(width,width,i);
     13hold on
     14
    915%plot mesh boundaries
    10 subplot(width,width,i);
    11 
    12 %units
    13 if exist(options,'unit'),
    14         unit=getfieldvalue(options,'unit');
    15         md.x=md.x*unit;
    16         md.y=md.y*unit;
    17         md.z=md.z*unit;
    18 end
    19 
    2016for i=1:size(md.segments,1),
    21         plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'k.-');hold on;
     17        plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-');
    2218end
    2319
    2420%plot rift velocities
    25 hold on;
    26 
    2721isp1=0;
    2822isp2=0;
     
    3125        %plot mesh boundaries
    3226        for i=1:size(md.segments,1),
    33                 h1=plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'b-');
     27                h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'b-');
    3428        end
    3529        for i=1:size(md.rifts,1),
     
    3832                segments=md.rifts(i).segments;
    3933                for j=1:size(segments,1),
    40                         plot(md.x(segments(j,1:2)),md.y(segments(j,1:2)),'b-');
     34                        plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
    4135                end
    4236
     
    5044                        %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
    5145                        if(penetration>0),
    52                                 p2=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'r*');
     46                                p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'r*');
    5347                                isp2=1;
    5448                        else
    55                                 p1=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'k*');
     49                                p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k*');
    5650                                isp1=1;
    5751                        end
     
    5953
    6054                %point out the tips
    61                 h2=plot(md.x(md.rifts(i).tips(1)),md.y(md.rifts(i).tips(1)),'g*');
    62                 plot(md.x(md.rifts(i).tips(2)),md.y(md.rifts(i).tips(2)),'g*');
     55                h2=plot(x(md.rifts(i).tips(1)),y(md.rifts(i).tips(1)),'g*');
     56                plot(x(md.rifts(i).tips(2)),y(md.rifts(i).tips(2)),'g*');
    6357
    6458                %plot relative velocities
    65                 h=quiver(md.x(penaltypairs(:,1)),md.y(penaltypairs(:,1)),md.vx(penaltypairs(:,2))-md.vx(penaltypairs(:,1)),md.vy(penaltypairs(:,2))-md.vy(penaltypairs(:,1)));
     59                h=quiver(x(penaltypairs(:,1)),y(penaltypairs(:,1)),md.vx(penaltypairs(:,2))-md.vx(penaltypairs(:,1)),md.vy(penaltypairs(:,2))-md.vy(penaltypairs(:,1)));
    6660                set(h,'Color',[0 1 0]);
    6761        end
     
    7872        error('plot error message: no rifts available!');
    7973end
     74hold off
    8075
    8176%apply options
  • issm/trunk/src/m/classes/public/plot/plot_rifts.m

    r2694 r2695  
    11function plot_rifts(md,options,width,i);
    2 %PLOT_RIFTVEL - plot rifts in a mesh
     2%PLOT_RIFTS - plot rifts in a mesh
    33%
    44%   Usage:
     
    77%   See also: PLOTMODEL
    88
    9 %plot mesh boundaries
     9%process data and model
     10[x y z elements is2d]=processmesh(md,options);
     11
     12%plot mesh
    1013subplot(width,width,i);
    1114
    12 %units
    13 if exist(options,'unit'),
    14         unit=getfieldvalue(options,'unit');
    15         md.x=md.x*unit;
    16         md.y=md.y*unit;
    17         md.z=md.z*unit;
    18 end
    19 
    20 if exist(options,'offset'),
    21         offset=getfieldvalue(options,'offset');
    22 else
    23         offset=500;
    24 end
    25 
    26 
    27 %plot rifts
    28 hold on;
    29 
    30 isp1=0;
    31 isp2=0;
    32                        
    3315%offset to separate rift flanks.
    34 
     16offset=getfieldvalue(options,'offset',500);
    3517if isstruct(md.rifts),
    3618       
     
    4224                        normal(1)=penaltypairs(j,5);
    4325                        normal(2)=penaltypairs(j,6);
    44                         md.x(penaltypairs(j,1))=md.x(penaltypairs(j,1))-normal(1)*offset;
    45                         md.y(penaltypairs(j,1))=md.y(penaltypairs(j,1))-normal(2)*offset;
     26                        x(penaltypairs(j,1))=x(penaltypairs(j,1))-normal(1)*offset;
     27                        y(penaltypairs(j,1))=y(penaltypairs(j,1))-normal(2)*offset;
    4628                end
    4729        end
    4830end
    49 
    50 %process data and model
    51 [x y z elements is2d]=processmesh(md,options);
    52 
    53 %plot mesh
    54 subplot(width,width,i);
    5531
    5632%plot mesh
     
    6743end
    6844
    69 
    7045%apply options
    7146options=addfielddefault(options,'title','Rifts');
  • issm/trunk/src/m/classes/public/plot/plot_riftvel.m

    r2691 r2695  
    77%   See also: PLOTMODEL
    88
     9%process data and model
     10[x y z elements is2d]=processmesh(md,options);
     11
     12subplot(width,width,i);
     13hold on
     14
    915%plot mesh boundaries
    10 subplot(width,width,i);
    11 
    12 %units
    13 if exist(options,'unit'),
    14         unit=getfieldvalue(options,'unit');
    15         md.x=md.x*unit;
    16         md.y=md.y*unit;
    17         md.z=md.z*unit;
    18 end
    19 
    2016for i=1:size(md.segments,1),
    21         plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'k.-');hold on;
     17        plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-');
    2218end
    2319
    2420%plot rift velocities
    25 hold on;
    26 
    2721isp1=0;
    2822isp2=0;
     
    3125        %plot mesh boundaries
    3226        for i=1:size(md.segments,1),
    33                 h1=plot(md.x(md.segments(i,1:2)),md.y(md.segments(i,1:2)),'b-');
     27                h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'b-');
    3428        end
    3529        for i=1:size(md.rifts,1),
     
    3832                segments=md.rifts(i).segments;
    3933                for j=1:size(segments,1),
    40                         plot(md.x(segments(j,1:2)),md.y(segments(j,1:2)),'b-');
     34                        plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
    4135                end
    4236
     
    5044                        %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
    5145                        if(penetration>0),
    52                                 p2=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'r*');
     46                                p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'r*');
    5347                                isp2=1;
    5448                        else
    55                                 p1=plot(md.x(penaltypairs(j,1)) ,md.y(penaltypairs(j,1)),'k*');
     49                                p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k*');
    5650                                isp1=1;
    5751                        end
     
    5953
    6054                %point out the tips
    61                 h2=plot(md.x(md.rifts(i).tips(1)),md.y(md.rifts(i).tips(1)),'g*');
    62                 plot(md.x(md.rifts(i).tips(2)),md.y(md.rifts(i).tips(2)),'g*');
     55                h2=plot(x(md.rifts(i).tips(1)),y(md.rifts(i).tips(1)),'g*');
     56                plot(x(md.rifts(i).tips(2)),y(md.rifts(i).tips(2)),'g*');
    6357                segments=md.rifts(i).segments(:,1:2);
    64                 h3=quiver(md.x(segments),md.y(segments),md.vx(segments),md.vy(segments));
     58                h3=quiver(x(segments),y(segments),md.vx(segments),md.vy(segments));
    6559                set(h3,'Color',[1 0 0]);
    6660        end
     
    7771        error('plot error message: no rifts available!');
    7872end
     73hold off
    7974
    8075%apply options
  • issm/trunk/src/m/classes/public/plot/plotdoc.m

    r2498 r2695  
    3030disp('                  - ''riftpenetration'': penetration levels for a fault');
    3131disp('                  - ''riftfraction'': fill fractions for every node of the rifts');
     32disp('                  - ''rifts'': plot mesh with an offset so that rifts are visible');
    3233disp('                  - ''strainrate_tensor'': plot the components of the strainrate tensor (exx,eyy,ezz,exy,exz,eyz) if computed');
    3334disp('                  - ''strainrate_principal'': plot the strainrate tensor principal axis and principal values)');
Note: See TracChangeset for help on using the changeset viewer.