Changeset 92 for trunk/src


Ignore:
Timestamp:
May 21, 2010, 5:44:57 PM (15 years ago)
Author:
gostiaux
Message:

Plotting vectors centered on the middle of the arrow. Apparently this does not create any bug.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r89 r92  
    10221022    %plot vectors:
    10231023    quiresetn(haxes,vec_X,vec_Y,vec_U,vec_V,scale,colorlist,col_vec);   
     1024
    10241025else
    10251026    hvec=findobj(haxes,'Tag','vel');
     
    10991100%INPUT:
    11001101% haxes: handles of the plotting axes
    1101 %x,y,u,v: vectors coordinates and vector components to plot, arrays withb the same dimension
     1102% x,y,u,v: vectors coordinates and vector components to plot, arrays withb the same dimension
    11021103% scale: scaling factor for vector length representation
    1103 %colorlist(icolor,:): list of vector colors, dim (nbcolor,3), depending on color #i
    1104 %col_vec: matlab vector setting the color number #i for each velocity vector
     1104% 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
    11051106function quiresetn(haxes,x,y,u,v,scale,colorlist,col_vec)
    11061107%-------------------------------------------------------------------
     
    11341135    n=size(xc);
    11351136    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(:)]';
    11371139    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(:)]';
    11391142    maty=reshape(maty,1,3*n(2));
    11401143   
     
    11421145    arrowplus=rot*[uc;vc];
    11431146    arrowmoins=rot'*[uc;vc];
    1144     x1=xc+uc-arrowplus(1,:);
    1145     x2=xc+uc;
    1146     x3=xc+uc-arrowmoins(1,:);
    1147     y1=yc+vc-arrowplus(2,:);
    1148     y2=yc+vc;
    1149     y3=yc+vc-arrowmoins(2,:);
     1147    x1=xc+uc/2-arrowplus(1,:);
     1148    x2=xc+uc/2;
     1149    x3=xc+uc/2-arrowmoins(1,:);
     1150    y1=yc+vc/2-arrowplus(2,:);
     1151    y2=yc+vc/2;
     1152    y3=yc+vc/2-arrowmoins(2,:);
     1153%     x1=xc+uc-arrowplus(1,:);
     1154%     x2=xc+uc;
     1155%     x3=xc+uc-arrowmoins(1,:);
     1156%     y1=yc+vc-arrowplus(2,:);
     1157%     y2=yc+vc;
     1158%     y3=yc+vc-arrowmoins(2,:);
    11501159    matxar=[x1(:) x2(:) x3(:) xN(:)]';
    11511160    matxar=reshape(matxar,1,4*n(2));
     
    11531162    matyar=reshape(matyar,1,4*n(2));
    11541163    %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   
    11551170    isn=isnan(colorlist(icolor,:));%test if color NaN
    11561171    if 2*icolor > sizh(1) %if icolor exceeds the number of existing ones
     
    11611176                line(matx,maty,'Color',colorlist(icolor,:),'Tag','vel');% plot new lines
    11621177                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
    11641181        end
    11651182    else
     
    12101227YTick=ord*values(ind);
    12111228end
     1229
  • trunk/src/px_XYZ.m

    r84 r92  
    5656        Y=Yphys*Calib.Pxcmy;
    5757end
     58
     59
     60
Note: See TracChangeset for help on using the changeset viewer.