Changeset 3202 for issm/trunk/src/m/classes/public/plot/plot_riftrelvel.m
- Timestamp:
- 03/05/10 14:49:35 (15 years ago)
- 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);1 function plot_riftrelvel(md,options,nlines,ncols,index); 2 2 %PLOT_RIFTRELVEL - plot rift relative velocities 3 3 % 4 4 % Usage: 5 % plot_riftrelvel(md,options, width,i);5 % plot_riftrelvel(md,options,nlines,ncols,i); 6 6 % 7 7 % See also: PLOTMODEL … … 17 17 18 18 %set as NaN all velocities not on rifts 19 for i=1:size(md.rifts,1), 19 u=NaN*ones(md.numberofgrids,1); 20 v=NaN*ones(md.numberofgrids,1); 21 for i=1:md.numrifts, 20 22 penaltypairs=md.rifts(i).penaltypairs(:,[1 2]); 21 u=NaN*ones(md.numberofgrids,1);22 v=NaN*ones(md.numberofgrids,1);23 23 u(md.rifts(i).penaltypairs(:,1))=md.vx(penaltypairs(:,1))-md.vx(penaltypairs(:,2)); 24 24 v(md.rifts(i).penaltypairs(:,1))=md.vy(penaltypairs(:,1))-md.vy(penaltypairs(:,2)); … … 31 31 32 32 %prepare plot 33 subplot( width,width,i);33 subplot(nlines,ncols,index); 34 34 hold on 35 35 … … 37 37 for i=1:size(md.segments,1), 38 38 plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-'); 39 end 40 41 %plot rifts vel 42 h3=[]; 43 for 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]; 39 50 end 40 51 … … 47 58 h1=plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'b-'); 48 59 end 49 50 for i=1:size(md.rifts,1), 60 for i=1:md.numrifts, 61 51 62 %get grids on rift 52 63 penaltypairs=md.rifts(i).penaltypairs; … … 66 77 %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red. 67 78 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); 69 80 isp2=1; 70 81 else … … 79 90 segments=md.rifts(i).segments(:,1:2); 80 91 end 81 82 %plot rifts vel83 h3=[];84 for i=1:quivers.numcolors85 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 end92 93 92 %legend 94 93 if isp1 & isp2
Note:
See TracChangeset
for help on using the changeset viewer.