SAS vectorplot

从xorigin -----> x

yorigin    ------> y的合成向量

/*--4_2_9 Data Set VECTOR--*/ 
data GTL_GS_vector;
format label 3.0; 
do i=1 to 10; 
x=ranuni(2); xo=x*(1+(ranuni(2)-0.5)); 
y=ranuni(2); yo=y*(1+(ranuni(2)-0.5)); 
if (ranuni(2) < 0.5) then Type='A'; 
else Type='B';
label=(2*x+3*y); 
output; 
end; 
run; 


*
xorigin  ----> x
yorigin  ----> y
arrowheadshape = 
sortorder = ascendingformatted
;


ods html;

proc template;
define statgraph _vectorplot;
begingraph;
    layout overlay;
        vectorplot x = x y = y xorigin = xo yorigin = yo / group = type name = "a"
                            arrowheadshape = barbed datalabel = label 
                            lineattrs = (thickness = 2);
        discretelegend "a" / sortorder = descendingformatted title = "Type: "
                            location = inside valign = top halign = right;
    endlayout;
endgraph;
end;
run;

proc sgrender data = GTL_GS_vector template = _vectorplot;
run;

 

posted @ 2021-10-05 12:38  Iving  阅读(126)  评论(0编辑  收藏  举报