Changeset 2695
- Timestamp:
- 12/02/09 08:01:09 (15 years ago)
- 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 1 1 function plot_riftfraction(md,options,width,i); 2 %PLOT_RIFT RELVEL- plot rift fractions2 %PLOT_RIFTFRACTION - plot rift fractions 3 3 % 4 4 % Usage: … … 7 7 % See also: PLOTMODEL 8 8 9 %process data and model 10 [x y z elements is2d]=processmesh(md,options); 11 12 subplot(width,width,i); 13 hold on 14 9 15 %plot mesh boundaries 10 subplot(width,width,i);11 12 %units13 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 end19 20 16 for 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.-'); 22 18 end 23 19 … … 38 34 for i=1:length(md.rifts), 39 35 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(:)); 42 38 zc=fractions(segments(:)); 43 39 h2=patch('Xdata',xc,'Ydata',yc,'Zdata',zc,'Cdata',zc,'facecolor','none','edgecolor','flat'); 44 40 end 45 41 legend([h1,h2],'mesh boundaries','rifts') 42 hold off 46 43 47 44 %apply options 48 options=addfielddefault(options,'title','Rift relative velocities');45 options=addfielddefault(options,'title','Rift ice/water fraction ???????'); %Eric, could you enter a better title? 49 46 options=addfielddefault(options,'colorbar',0); 50 47 applyoptions(md,[],options); -
issm/trunk/src/m/classes/public/plot/plot_riftpenetration.m
r2439 r2695 7 7 % See also: PLOTMODEL 8 8 9 %process data and model 10 [x y z elements is2d]=processmesh(md,options); 11 12 subplot(width,width,i); 13 hold on 14 9 15 %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; 16 for i=1:size(md.segments,1), 17 plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-'); 18 18 end 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 end23 24 hold on;25 19 26 20 isp1=0; … … 30 24 %plot mesh boundaries 31 25 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-'); 33 27 end 34 28 for i=1:size(md.rifts,1), … … 37 31 segments=md.rifts(i).segments; 38 32 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-'); 40 34 end 41 35 … … 52 46 %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red. 53 47 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*'); 55 49 isp2=1; 56 50 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*'); 58 52 isp1=1; 59 53 end … … 61 55 62 56 %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*'); 65 59 end 66 60 if isp1 & isp2 … … 76 70 error('plot error message: no rifts available!'); 77 71 end 72 hold off 78 73 79 74 %apply options -
issm/trunk/src/m/classes/public/plot/plot_riftrelvel.m
r2439 r2695 7 7 % See also: PLOTMODEL 8 8 9 %process data and model 10 [x y z elements is2d]=processmesh(md,options); 11 12 subplot(width,width,i); 13 hold on 14 9 15 %plot mesh boundaries 10 subplot(width,width,i);11 12 %units13 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 end19 20 16 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;17 plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-'); 22 18 end 23 19 24 20 %plot rift velocities 25 hold on;26 27 21 isp1=0; 28 22 isp2=0; … … 31 25 %plot mesh boundaries 32 26 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-'); 34 28 end 35 29 for i=1:size(md.rifts,1), … … 38 32 segments=md.rifts(i).segments; 39 33 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-'); 41 35 end 42 36 … … 50 44 %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red. 51 45 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*'); 53 47 isp2=1; 54 48 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*'); 56 50 isp1=1; 57 51 end … … 59 53 60 54 %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*'); 63 57 64 58 %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))); 66 60 set(h,'Color',[0 1 0]); 67 61 end … … 78 72 error('plot error message: no rifts available!'); 79 73 end 74 hold off 80 75 81 76 %apply options -
issm/trunk/src/m/classes/public/plot/plot_rifts.m
r2694 r2695 1 1 function plot_rifts(md,options,width,i); 2 %PLOT_RIFT VEL- plot rifts in a mesh2 %PLOT_RIFTS - plot rifts in a mesh 3 3 % 4 4 % Usage: … … 7 7 % See also: PLOTMODEL 8 8 9 %plot mesh boundaries 9 %process data and model 10 [x y z elements is2d]=processmesh(md,options); 11 12 %plot mesh 10 13 subplot(width,width,i); 11 14 12 %units13 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 end19 20 if exist(options,'offset'),21 offset=getfieldvalue(options,'offset');22 else23 offset=500;24 end25 26 27 %plot rifts28 hold on;29 30 isp1=0;31 isp2=0;32 33 15 %offset to separate rift flanks. 34 16 offset=getfieldvalue(options,'offset',500); 35 17 if isstruct(md.rifts), 36 18 … … 42 24 normal(1)=penaltypairs(j,5); 43 25 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; 46 28 end 47 29 end 48 30 end 49 50 %process data and model51 [x y z elements is2d]=processmesh(md,options);52 53 %plot mesh54 subplot(width,width,i);55 31 56 32 %plot mesh … … 67 43 end 68 44 69 70 45 %apply options 71 46 options=addfielddefault(options,'title','Rifts'); -
issm/trunk/src/m/classes/public/plot/plot_riftvel.m
r2691 r2695 7 7 % See also: PLOTMODEL 8 8 9 %process data and model 10 [x y z elements is2d]=processmesh(md,options); 11 12 subplot(width,width,i); 13 hold on 14 9 15 %plot mesh boundaries 10 subplot(width,width,i);11 12 %units13 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 end19 20 16 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;17 plot(x(md.segments(i,1:2)),y(md.segments(i,1:2)),'k.-'); 22 18 end 23 19 24 20 %plot rift velocities 25 hold on;26 27 21 isp1=0; 28 22 isp2=0; … … 31 25 %plot mesh boundaries 32 26 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-'); 34 28 end 35 29 for i=1:size(md.rifts,1), … … 38 32 segments=md.rifts(i).segments; 39 33 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-'); 41 35 end 42 36 … … 50 44 %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red. 51 45 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*'); 53 47 isp2=1; 54 48 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*'); 56 50 isp1=1; 57 51 end … … 59 53 60 54 %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*'); 63 57 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)); 65 59 set(h3,'Color',[1 0 0]); 66 60 end … … 77 71 error('plot error message: no rifts available!'); 78 72 end 73 hold off 79 74 80 75 %apply options -
issm/trunk/src/m/classes/public/plot/plotdoc.m
r2498 r2695 30 30 disp(' - ''riftpenetration'': penetration levels for a fault'); 31 31 disp(' - ''riftfraction'': fill fractions for every node of the rifts'); 32 disp(' - ''rifts'': plot mesh with an offset so that rifts are visible'); 32 33 disp(' - ''strainrate_tensor'': plot the components of the strainrate tensor (exx,eyy,ezz,exy,exz,eyz) if computed'); 33 34 disp(' - ''strainrate_principal'': plot the strainrate tensor principal axis and principal values)');
Note:
See TracChangeset
for help on using the changeset viewer.