Changeset 13870
- Timestamp:
- 11/04/12 15:03:26 (12 years ago)
- Location:
- issm/trunk-jpl/src/m/plot
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/curvedarrow.m
r13836 r13870 10 10 % 'ratio': default .5 (ratio headarrow/length) 11 11 % 'widthratio': default is 1/10 of length 12 % 'width': if you want to specify an absolute width 12 13 13 14 %recover options 14 15 options=pairoptions(varargin{:}); 15 16 ratio=getfieldvalue(options,'ratio',.1); 16 widthratio=getfieldvalue(options,'widthratio',.1);17 arrowlength=getfieldvalue(options,'arrowlength',1); 17 18 color=getfieldvalue(options,'color','k'); 18 19 … … 23 24 %compute some values out of (x1,y1) and (x2,y2) 24 25 length=distance*angle; 25 width=length*widthratio; 26 27 if exist(options,'widthratio'), 28 widthratio=getfieldvalue(options,'widthratio'); 29 width=length*widthratio; 30 else if exist(options,'width'), 31 width=getfieldvalue(options,'width'); 32 else 33 widthratio=.1; 34 width=length*widthratio; 35 end 26 36 27 37 %buidl the arrow itself: … … 41 51 E=D+2/3*(D-C); 42 52 F=C+2/3*(C-D); 53 43 54 n=(F-E)/norm(F-E,2); 44 55 m=[-n(2) n(1)]; … … 46 57 m=-m; 47 58 end 48 d=(distance*angle)*ratio; 59 60 if exist(options,'arrowlength'), 61 d=arrowlength; 62 else 63 d=abs((distance*angle)*ratio); 64 end 49 65 50 66 %G is d distance from middle of E and F: -
issm/trunk-jpl/src/m/plot/plot_riftrelvel.m
r13836 r13870 79 79 %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red. 80 80 if(penetration>0), 81 p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),' *','MarkerSize',markersize); set(p2,'Color',[140 140 140]/255);81 p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'.','MarkerSize',markersize); set(p2,'Color',[140 140 140]/255); 82 82 isp2=1; 83 83 else 84 p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k *','MarkerSize',markersize);84 p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k.','MarkerSize',markersize); 85 85 isp1=1; 86 86 end … … 88 88 89 89 %point out the tips 90 h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g *','MarkerSize',markersize);91 plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g *','MarkerSize',markersize);90 h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g.','MarkerSize',markersize); 91 plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g.','MarkerSize',markersize); 92 92 segments=md.rifts.riftstruct(i).segments(:,1:2); 93 93 end
Note:
See TracChangeset
for help on using the changeset viewer.