SURVO 98 edit field: 101 2000 300 (32 bit version) 0001|*SAVE ARROWS / Vector diagrams in SURVO MM 20 Oct 2009/SM S | 1 0002|*/LMAX 0003|- [PSAVE][M] 0004|*Vector diagrams in SURVO MM ## 0005|*__________________________________________________________________ 0006|- [PRESTORE] 0008|**GLOBAL* 0009|*HEADER= XLABEL= YLABEL= FRAME=1 XDIV=0,1,0 YDIV=0,1,0 0010|*SIZE=300,300 SCALE=0.8:_,1,2,2.2:_ 0012|*Before printing, plot the 11 first graphs A1-A11 by activating: S | 111111111111111111111111111111111111111111111111111111111111111 0013|*/ACTIVATE " S | 11111111111 0014|*and S | 111 0015|*GOTO S S | 111111 0016|*After making all graphs, reload ARROWS and activate PRINT below: 0017|*................................ 0019|*PRINT CUR+2,E TO VectorDiagrams.ps S | 5555555555555555555555555555555555 0020|*/GS-PDF VectorDiagrams.ps S | 5555555555555555555555555 0021|- define [M] [Courier(10)][line_spacing(10)][left_margin(12)] 0022|- [M] 0024|- [page_number(2)] 0025|- header_lines 3,6 0026|- [Swiss(15)] 0027|*Vector diagrams in SURVO MM (ver.3.13+) 20 Oct 2009 / SM 0029|- [M] 0030|*Extract from the Help pages: S | 1111111111111111111111111111 0031|*ARROWS? 0032|*(in PostScript graphics only) 0033|*Points in a scatter plot can be connected by arrows (or line segments) 0034|*by giving an ARROWS specification. 0035|*Its simplest form is 0036|*ARROWS=A 0037|*where A=[a_ij] is an incidence matrix saved as a matrix file and 0038|*a_ij=1 means that points of observations i and j are to be connected 0039|*and a_ij=0 that points i and j are not to be connected. 0040|*It is assumed that when the data set has n observations, A is an 0041|*n x n matrix. Thus restrictions by IND, CASES etc. are not permitted. 0043|*The general form of ARROWS is 0044|*ARROWS=matrix,gap,type,alen,angle 0045|*where default 0046|*matrix: incidence matrix (MAT file) - 0047|*gap: distance from end points (in plotting units) 0 0048|*type: 0=no arrow, 1=end arrow, 2=start arrow, 3=both, 4= <--> 0 0049|* corresponding negative value = filled arrow head 0050|*alen: length of arrow (in plotting units) 20 0051|*angle: angle (sharpness) of arrow (in radians) pi/6 0053|*To give a possibility to configure each connection individually 0054|*(i.e. variation in line width, type, and color as well as in arrow type), 0055|*the non-zero elements can be presented as decimal numbers of form 0056|* a_ij = swww.tacc 0057|*where www (one or more digits) is the line width as multiple of 0058|* 0.24 Points, 0.24(Point:mm)=0.084666..., 0059|* t (one digit) is index of line type (LINETYPE?), 0060|* a (one digit) is arrow type (see the list above), 0061|* cc (two digits) is the index of color given by FILL spec., 0062|* s (sign) '-' gives filled arrow head(s). 0064|*For example, a_ij=-5.0304 implies an arrow having width 5*0.24=1.2 Points, 0065|*solid line type (0), arrow type >---> (3), filled arrow heads (-), and 0066|*color (4) specified by FILL(-4)=c,m,y,k (See PSCOLOR?). 0068|*Examples: S | 111111111 0069|*...................... 0070|*DATA Data1 0071|*Name X Y 0072|*P1 1 1 0073|*P2 1 2 0074|*P3 1.8 1.2 0075|*P4 2 2 0077|*Lines (arrows) defined by an incidence matrix: 0078|*MATRIX A 0079|*/// P1 P2 P3 P4 0080|*P1 0 1 0 1 0081|*P2 0 0 0 1 0082|*P3 0 1 0 0 0083|*P4 0 0 1 0 0085|"MAT SAVE A 0087|*Simple lines: 0088|"PLOT Data1,X,Y / ARROWS=A DEVICE=PS,A1.PS 0089|- [PRINT_OFF] 0090|*/GS-PDF A1.PS 0091|- [PRINT_ON] 0092|% 300 0093|- picture A1.PS 0094|- [M] 0096|( 0097|*...................... 0098|*Simple lines (gaps of 40 plotting units from each point) 0099|"PLOT Data1,X,Y / ARROWS=A,40 DEVICE=PS,A2.PS POINT=Name S | 11 0100|- [PRINT_OFF] 0101|*/GS-PDF A2.PS 0102|- [PRINT_ON] 0103|% 300 0104|- picture A2.PS 0105|- [M] 0106|) 0107|( 0108|*........................ 0109|*Arrow head at the end point: 0110|"PLOT Data1,X,Y / ARROWS=A,40,1 DEVICE=PS,A3.PS POINT=Name S | 1 0111|- [PRINT_OFF] 0112|*/GS-PDF A3.PS 0113|- [PRINT_ON] 0114|% 300 0115|- picture A3.PS 0116|- [M] 0117|) 0118|( 0119|*........................ 0120|*Arrow head at both ends (3), arrow side length 30 and angle pi/12: 0121|*pi=3.141592653589793 0122|"PLOT Data1,X,Y / ARROWS=A,40,3,30,pi/12 DEVICE=PS,A4.PS S | 1 11 11111 0123|- [PRINT_OFF] 0124|*/GS-PDF A4.PS 0125|- [PRINT_ON] 0126|% 300 0127|- picture A4.PS 0128|- [M] 0129|) 0130|( 0131|*........................ 0132|*"Line segments": 0133|*pi=3.141592653589793 0134|"PLOT Data1,X,Y / ARROWS=A,40,3,10,pi/2 DEVICE=PS,A6.PS POINT=Name S | 1111 0135|- [PRINT_OFF] 0136|*/GS-PDF A6.PS 0137|- [PRINT_ON] 0138|% 300 0139|- picture A6.PS 0140|- [M] 0141|) 0142|( 0143|*........................ 0144|*Filled arrow heads: 0145|"PLOT Data1,X,Y / ARROWS=A,40,-1,30 DEVICE=PS,A7.PS POINT=Name S | 11 0146|- [PRINT_OFF] 0147|*/GS-PDF A7.PS 0148|- [PRINT_ON] 0149|% 300 0150|- picture A7.PS 0151|- [M] 0152|) 0153|( 0154|*........................ 0155|*Filled arrow heads at both ends: 0156|"PLOT Data1,X,Y / ARROWS=A,40,-3,30 DEVICE=PS,A8.PS POINT=Name S | 11 0157|- [PRINT_OFF] 0158|*/GS-PDF A8.PS 0159|- [PRINT_ON] 0160|% 300 0161|- picture A8.PS 0162|- [M] 0163|) 0164|( 0165|*........................ 0166|*Setting joint line width, type, and color: 0167|*DEVICE=PS,A9.PS POINT=Name 0168|*ARROWS=[line_width(1)][line_type(3)][RED],A,40,-3,30 S | 1111111111111111111111111111111111 0169|"PLOT Data1,X,Y 0170|- [PRINT_OFF] 0171|*/GS-PDF A9.PS 0172|- [PRINT_ON] 0173|% 300 0174|- picture A9.PS 0175|- [M] 0176|) 0177|( 0178|*........................ 0179|*arrow type 4: <------> 0180|"PLOT Data1,X,Y / ARROWS=A,40,4 DEVICE=PS,A10.PS S | 1 0181|- [PRINT_OFF] 0182|*/GS-PDF A10.PS 0183|- [PRINT_ON] 0184|% 300 0185|- picture A10.PS 0186|- [M] 0187|) 0188|( 0189|*........................ 0190|*Generalized incidence matrix: 0191|*MATRIX B 0192|*/// P1 P2 P3 P4 0193|*P1 0 1 0 x // x=-5.2101 0194|*P2 0 0 0 1 0195|*P3 x y 0 0 // y=-5.0401 0196|*P4 0 0 z 0 // z=1.0102 0198|"MAT SAVE B 0200|*FILL(-1)=0,1,1,0 FILL(-2)=0.5,0,0.5,0 0201|"PLOT Data1,X,Y / ARROWS=B,40,+3,30,50 DEVICE=PS,A11.PS 0202|- [PRINT_OFF] 0203|*/GS-PDF A11.PS 0204|- [PRINT_ON] 0205|% 300 0206|- picture A11.PS 0207|- [M] 0208|) 0209|/ 0211|- [Swiss(15)] 0212|*Correlation matrix as a vector diagram: 0213|- [M] 0214|- [PRINT_OFF] 0215|S Making the last graph Connections.ps 0216|*Before /ACTIVATE, 0217|*activate the next line while keeping the cursor in the control column: S | 1111111111111111111111111111 0218|*DELETE CUR+2,F 0219|- [PRINT_ON] 0220|**........................ 0221|**The graph is automatically generated and displayed by activating: 0222|**/ACTIVATE + 0223|** 0224|**Selecting variables in a proper order: 0225|**MASK=--BCDEFHIJKLAG 0226|** 0227|*+CORR DECA 0228|*+MAT LOAD CORR.M,11.1,CUR+1 0229|**MATRIX CORR.M 0230|**R(DECA) 0231|**/// Heig 100m L_ju Shot Hi_j 400m Weig Hurd Disc Pole Jave 1500 0232|**Height 1.0 -0.1 -0.0 0.6 0.1 -0.2 0.9 0.2 0.6 -0.4 -0.0 -0.2 0233|**100m -0.1 1.0 0.2 -0.0 -0.4 0.5 -0.1 0.3 0.0 0.1 -0.2 -0.3 0234|**L_jump -0.0 0.2 1.0 -0.0 -0.0 0.1 -0.1 0.3 0.0 0.1 0.2 -0.2 0235|**Shot_put 0.6 -0.0 -0.0 1.0 0.2 -0.3 0.7 0.1 0.7 -0.2 0.0 -0.4 0236|**Hi_jump 0.1 -0.4 -0.0 0.2 1.0 -0.3 0.2 -0.0 0.2 -0.1 0.1 -0.1 0237|**400m -0.2 0.5 0.1 -0.3 -0.3 1.0 -0.3 0.2 -0.3 0.0 -0.1 0.3 0238|**Weight 0.9 -0.1 -0.1 0.7 0.2 -0.3 1.0 0.1 0.6 -0.3 -0.1 -0.4 0239|**Hurdles 0.2 0.3 0.3 0.1 -0.0 0.2 0.1 1.0 0.0 -0.1 -0.1 -0.2 0240|**Discus 0.6 0.0 0.0 0.7 0.2 -0.3 0.6 0.0 1.0 -0.2 0.1 -0.6 0241|**Pole_vlt -0.4 0.1 0.1 -0.2 -0.1 0.0 -0.3 -0.1 -0.2 1.0 -0.1 0.0 0242|**Javelin -0.0 -0.2 0.2 0.0 0.1 -0.1 -0.1 -0.1 0.1 -0.1 1.0 -0.1 0243|**1500m -0.2 -0.3 -0.2 -0.4 -0.1 0.3 -0.4 -0.2 -0.6 0.0 -0.1 1.0 0244|** 0245|**Stepwise transformation of the correlation matrix 0246|**to a suitable generalized incidence matrix: 0247|**n=12 0248|*+MAT R=CORR.M 0249|**Removing diagonal elements: 0250|*+MAT R=R-IDN(n,n) 0251|**Multiplying correlations by 10 and rounding to the closest integer: 0252|*+MAT TRANSFORM R BY round(10*X#) 0253|**Setting color 1 for positive correlations and 2 for negative: 0254|*+MAT #TRANSFORM R BY if(X#>0)then(abs(X#)+0.0001)else(abs(X#)+0.0002) 0255|**Setting heads for arrows starting from 'external' variables Height and Weight: 0256|*+MAT #TRANSFORM R BY if(I#=1)then(X#+0.01)else(X#) 0257|*+MAT #TRANSFORM R BY if(I#=7)then(X#+0.01)else(X#) 0258|**Setting 'too small' values to zero: 0259|*+MAT #TRANSFORM R BY if(X#<0.1)then(0)else(X#) 0260|**Removing heads from arrows between external variables: 0261|*+MAT R(1,7)=R(1,7)-0.01 0262|*+MAT R(7,1)=0 0263|**Converting to negative values (getting filled arrow heads): 0264|*+MAT R=(-1)*R 0265|** 0266|**(Data after activating two VAR operations below) 0267|**DATA DECA12,A,A+11,N,M 0268|** 0269|*MAAAAAAAA 11.111 11.111 11.111 11.111 0270|*NEvent X Y X' Y' 0271|** 0272|*AHeight 1.000 0.000 1.070 0.000 0273|**100m 0.866 0.500 0.913 0.550 0274|**L_jump 0.500 0.866 0.485 0.953 0275|**Shot_put 0.000 1.000 -0.100 1.100 0276|**Hi_jump -0.500 0.866 -0.685 0.953 0277|**400m -0.866 0.500 -1.113 0.550 0278|**Weight -1.000 0.000 -1.270 0.000 0279|**Hurdles -0.866 -0.500 -1.113 -0.550 0280|**Discus -0.500 -0.866 -0.685 -0.953 0281|**Pole_vlt -0.000 -1.000 -0.100 -1.100 0282|**Javelin 0.500 -0.866 0.485 -0.953 0283|**1500m 0.866 -0.500 0.913 -0.550 0284|** 0285|**Points on a regular polygon of n sides: 0286|**pi=3.141592653589793 0287|*+VAR X,Y TO DECA12 0288|**X=cos(2*(ORDER-1)/n*pi) 0289|**Y=sin(2*(ORDER-1)/n*pi) 0290|** 0291|*+PLOT DECA12,X,Y / POINT=3,20 ARROWS=R,50 0292|**FILL(-1)=0,1,1,0 FILL(-2)=1,1,0,0 0293|**DEVICE=PS,K1.PS SCALE=-1.5,1.5 0294|**SIZE=1500,1500 XDIV=0,1,0 YDIV=0,1,0 HEADER= XLABEL= YLABEL= FRAME=0 0295|**....................................... 0296|**pi=3.141592653589793 n=12 0297|**Larger ellipse for names with center moved to the left: 0298|**R1=1.17 R2=1.1 C=0.1 0299|*+VAR X',Y' TO DECA12 0300|**X'=R1*cos(2*(ORDER-1)/n*pi)-C 0301|**Y'=R2*sin(2*(ORDER-1)/n*pi) 0302|** 0303|*+PLOT DECA12,X',Y' / POINT=[Swiss(9)],Event 0304|**DEVICE=PS,K2.PS SCALE=-1.5,1.5 0305|**SIZE=1500,1500 XDIV=0,1,0 YDIV=0,1,0 XLABEL= YLABEL= FRAME=0 0306|**HEADER=[Swiss(15)],Connections_in_Decathlon 0307|**....................................... 0308|*+EPS JOIN Connections,K1,K2 0309|*+/GS-PDF Connections.PS 0310|F* 0311|% 1500 0312|- picture Connections.PS 0313|- [M] 0315|*It is easy to modify this setup for other correlation and distance 0316|*matrices. 0317|E