Ignore:
Timestamp:
03/05/10 14:49:35 (15 years ago)
Author:
Eric.Larour
Message:

corrections for plots

File:
1 edited

Legend:

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

    r2754 r3202  
    1 function plot_riftrelvel(md,options,width,i);
     1function plot_riftrelvel(md,options,nlines,ncols,index);
    22%PLOT_RIFTRELVEL - plot rift relative velocities
    33%
    44%   Usage:
    5 %      plot_riftrelvel(md,options,width,i);
     5%      plot_riftrelvel(md,options,nlines,ncols,i);
    66%
    77%   See also: PLOTMODEL
     
    1717
    1818%set as NaN all velocities not on rifts
    19 for i=1:size(md.rifts,1),
     19u=NaN*ones(md.numberofgrids,1);
     20v=NaN*ones(md.numberofgrids,1);
     21for i=1:md.numrifts,
    2022        penaltypairs=md.rifts(i).penaltypairs(:,[1 2]);
    21         u=NaN*ones(md.numberofgrids,1);
    22         v=NaN*ones(md.numberofgrids,1);
    2323        u(md.rifts(i).penaltypairs(:,1))=md.vx(penaltypairs(:,1))-md.vx(penaltypairs(:,2));
    2424        v(md.rifts(i).penaltypairs(:,1))=md.vy(penaltypairs(:,1))-md.vy(penaltypairs(:,2));
     
    3131
    3232%prepare plot
    33 subplot(width,width,i);
     33subplot(nlines,ncols,index);
    3434hold on
    3535
     
    3737for i=1:size(md.segments,1),
    3838        plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-');
     39end
     40
     41%plot rifts vel
     42h3=[];
     43for i=1:quivers.numcolors
     44        pos=find(quivers.colorind==i);
     45        hprime=quiver(quivers.x(pos),quivers.y(pos),quivers.u(pos),quivers.v(pos),...
     46                'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
     47        hprime=quiver(quivers.x(pos),quivers.y(pos),-quivers.u(pos),-quivers.v(pos),...
     48                'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
     49        h3=[h3;hprime];
    3950end
    4051
     
    4758        h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'b-');
    4859end
    49 
    50 for i=1:size(md.rifts,1),
     60for i=1:md.numrifts,
     61       
    5162        %get grids on rift
    5263        penaltypairs=md.rifts(i).penaltypairs;
     
    6677                %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
    6778                if(penetration>0),
    68                         p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'r*');
     79                        p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'*'); set(p2,'Color',[140 140 140]/255);
    6980                        isp2=1;
    7081                else
     
    7990        segments=md.rifts(i).segments(:,1:2);
    8091end
    81 
    82 %plot rifts vel
    83 h3=[];
    84 for i=1:quivers.numcolors
    85         pos=find(quivers.colorind==i);
    86         hprime=quiver(quivers.x(pos),quivers.y(pos),quivers.u(pos),quivers.v(pos),...
    87                 'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
    88         hprime=quiver(quivers.x(pos),quivers.y(pos),-quivers.u(pos),-quivers.v(pos),...
    89                 'Color',palette(i,:),'ShowArrowHead','on','AutoScale','off');
    90         h3=[h3;hprime];
    91 end
    92 
    9392%legend
    9493if isp1 & isp2
Note: See TracChangeset for help on using the changeset viewer.