Changeset 92 for trunk/src/plot_field.m
 Timestamp:
 May 21, 2010, 5:44:57 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/plot_field.m
r89 r92 1022 1022 %plot vectors: 1023 1023 quiresetn(haxes,vec_X,vec_Y,vec_U,vec_V,scale,colorlist,col_vec); 1024 1024 1025 else 1025 1026 hvec=findobj(haxes,'Tag','vel'); … … 1099 1100 %INPUT: 1100 1101 % haxes: handles of the plotting axes 1101 % x,y,u,v: vectors coordinates and vector components to plot, arrays withb the same dimension1102 % x,y,u,v: vectors coordinates and vector components to plot, arrays withb the same dimension 1102 1103 % scale: scaling factor for vector length representation 1103 % colorlist(icolor,:): list of vector colors, dim (nbcolor,3), depending on color #i1104 % col_vec: matlab vector setting the color number #i for each velocity vector1104 % colorlist(icolor,:): list of vector colors, dim (nbcolor,3), depending on color #i 1105 % col_vec: matlab vector setting the color number #i for each velocity vector 1105 1106 function quiresetn(haxes,x,y,u,v,scale,colorlist,col_vec) 1106 1107 % … … 1134 1135 n=size(xc); 1135 1136 xN=NaN*ones(size(xc)); 1136 matx=[xc(:) xc(:)+uc(:) xN(:)]'; 1137 matx=[xc(:)uc(:)/2 xc(:)+uc(:)/2 xN(:)]'; 1138 % matx=[xc(:) xc(:)+uc(:) xN(:)]'; 1137 1139 matx=reshape(matx,1,3*n(2)); 1138 maty=[yc(:) yc(:)+vc(:) xN(:)]'; 1140 maty=[yc(:)vc(:)/2 yc(:)+vc(:)/2 xN(:)]'; 1141 % maty=[yc(:) yc(:)+vc(:) xN(:)]'; 1139 1142 maty=reshape(maty,1,3*n(2)); 1140 1143 … … 1142 1145 arrowplus=rot*[uc;vc]; 1143 1146 arrowmoins=rot'*[uc;vc]; 1144 x1=xc+ucarrowplus(1,:); 1145 x2=xc+uc; 1146 x3=xc+ucarrowmoins(1,:); 1147 y1=yc+vcarrowplus(2,:); 1148 y2=yc+vc; 1149 y3=yc+vcarrowmoins(2,:); 1147 x1=xc+uc/2arrowplus(1,:); 1148 x2=xc+uc/2; 1149 x3=xc+uc/2arrowmoins(1,:); 1150 y1=yc+vc/2arrowplus(2,:); 1151 y2=yc+vc/2; 1152 y3=yc+vc/2arrowmoins(2,:); 1153 % x1=xc+ucarrowplus(1,:); 1154 % x2=xc+uc; 1155 % x3=xc+ucarrowmoins(1,:); 1156 % y1=yc+vcarrowplus(2,:); 1157 % y2=yc+vc; 1158 % y3=yc+vcarrowmoins(2,:); 1150 1159 matxar=[x1(:) x2(:) x3(:) xN(:)]'; 1151 1160 matxar=reshape(matxar,1,4*n(2)); … … 1153 1162 matyar=reshape(matyar,1,4*n(2)); 1154 1163 %draw the line or modify the existing ones 1164 hx = [x1;x2;x3]; 1165 hy = [y1;y2;y3]; 1166 tri=reshape([1:3*length(uc)],3,[])'; 1167 d = tri(:,[1 2 3 1])'; 1168 1169 1155 1170 isn=isnan(colorlist(icolor,:));%test if color NaN 1156 1171 if 2*icolor > sizh(1) %if icolor exceeds the number of existing ones … … 1161 1176 line(matx,maty,'Color',colorlist(icolor,:),'Tag','vel');% plot new lines 1162 1177 line(matxar,matyar,'Color',colorlist(icolor,:),'Tag','vel');% plot arrows 1163 end 1178 % fill(hx(d),hy(d),colorlist(icolor,:),'EdgeColor','none',' 1179 % Tag','Vel'); 1180 end 1164 1181 end 1165 1182 else … … 1210 1227 YTick=ord*values(ind); 1211 1228 end 1229
Note: See TracChangeset
for help on using the changeset viewer.