10 ! PROGRAM TO GENERATE DATAPLOT SOURCE CODE FOR DOING GRAPHS FOR
20 ! PRESENTATIONS
30 DIM AN$[1],LA$[60]V,NA$[32]V
40 PRINT "PROGRAM TO GENERATE DATAPLOT (FORTRAN) SOURCE CODE"
41 PRINT "YOU SHOULD HAVE READ THE DATAPLOT USERS GUIDE FIRST"
42 PRINT "NOTE THAT:"
43 PRINT
44 PRINT "CHARACTER STRING LOCATIONS, AXIS LENGTH ARE IN INCHES"
45 PRINT "VECTOR AND POINT LOCATINS ARE ACTUAL DATA"
60 INPUT "NAME (ONLY) OF OUTPUT PROGRAM ";NA$
62 OPEN #3, NA$+".FOR/WR"
70 INPUT "SIZE OF WORK AREA (TYPICALLY 1000,2000,ETC) ";WS
71 IF WS<1000 OR WS>20000 THEN PRINT "BAD SIZE" : GOTO 70
80 PRINT #3, "      DIMENSION IWA("+FRMT$(WS,5)+")"
85 PRINT #3, "      DIMENSION X(100),Y(100)"
86 PRINT #3, "  888 FORMAT(F6.2,F6.2)"
87 ND=1
90 PRINT #3, "      CALL VOPEN (IWA,"+FRMT$(WS,5)+")"
91 INPUT "VALUE OF X,Y AT ORIGIN ";XO,YO
92 INPUT "INCREMENT OF X,Y PER INCH ";XI,YI
100 PRINT "OPTIONS ARE :"
101 PRINT "(1) DRAW VECTOR"
102 PRINT "(2) DRAW CHARACTER STRING"
103 PRINT "(3) PLOT MULTIPLE POINTS"
104 PRINT "(4) PLOT SINGLE POINT"
105 PRINT "(5) PLOT AXIS (X OR Y)"
106 PRINT "(6) END"
110 INPUT "ENTER OPTION ";A
111 IF A<1 OR A>6 THEN PRINT "INVALID" : GOTO 100
120 ON A GOTO 1000,2000,3000,4000,5000,6000
1000 ! DO VECTOR (SINGLE LINE BETWEEN TWO POINTS)
1010 INPUT "ENTER X1,Y1,X2,Y2 ";X1,Y1,X2,Y2
1011 X1=(X1-XO)/XI+1
1012 Y1=(Y1-YO)/YI+1
1013 X2=(X2-XO)/XI+1
1014 Y2=(Y2-YO)/YI+1
1020 PRINT #3, "      CALL VECTOR("+FRMT$(X1,5,2)+","+FRMT$(Y1,5,2)+","+FRMT$(X2,5,2)+","+FRMT$(Y2,5,2)+")"
1030 GOTO 100
2000 ! PLOT CHARACTER STRING
2010 INPUT "STARTING POINT (X,Y) ";X,Y
2020 INPUT "STRING ITSELF (MAX 60 CHAR) ";LA$
2021 NC=LEN(LA$)
2030 PRINT "ENTER ORIENTATION (1 TO 4)"
2031 PRINT "1 = SMALL, PARALELL TO Y-AXIS"
2032 PRINT "2 = SMALL, PARALLEL TO X-AXIS"
2033 PRINT "3 = LARGE, PARALLEL TO Y-AXIS"
2034 PRINT "4 = LARGE, PARALLEL TO X-ZXIS"
2040 INPUT "ORIENTATION ";OX
2050 PRINT #3, "      CALL CHARA("+FRMT$(X,5,2)+","+FRMT$(Y,5,2)+",";
2051 PRINT #3, FRMT$(NC,2)+"H"+LA$+","+FRMT$(OX,1)+","+FRMT$(NC,2)+",-1)"
2060 GOTO 100
3000 ! PLOT MULTIPLE POINTS
3010 INPUT "NUMBER OF POINTS ";NP
3020 OPEN #4,"DATA"+FRMT$(ND,1)+".DAT/WR"
3030 FOR I=1 TO NP
3040 INPUT "X,Y VALUE ";X,Y
3041 X=(X-XO)/XI+1
3042 Y=(Y-YO)/YI+1
3050 PRINT #4, FRMT$(X,6,2);FRMT$(Y,6,2)
3060 NEXT I
3070 CLOSE 4
3080 PRINT #3, "      CALL ASSIGN (3,'DATA"+FRMT$(ND,1)+".DAT',9)"
3090 PRINT #3, "      DO "+FRMT$(ND,1)+",I=1,"+FRMT$(NP,2)
3100 PRINT #3, "      READ (3,888) X(I),Y(I)"
3110 PRINT #3, "    "+FRMT$(ND,1)+" CONTINUE"
3111 ND=ND+1
3120 PRINT #3, "      CALL CLOSE(3)"
3130 INPUT "SYMBOL SELECT (1-5) NEGATIVE = LARGE SYMBOL ";SY
3140 INPUT "DISPLAY SELECT (-1=SYMBOLS, 0=LINE, 1=BOTH) ";DS
3150 PRINT #3, "      CALL FDATA(X,Y,"+FRMT$(SY,2)+","+FRMT$(NP,2)+",";
3151 PRINT #3, FRMT$(DS,2)+",0.0,1.0,0.0,1.0)"
3160 GOTO 100
4000 ! PLOT SINGLE POINT
4010 INPUT "POINT LOCATION (X,Y) ";X,Y
4020 INPUT "SYMBOL SELECT (1-5) NEGATIVE = LARGE SYMBOL ";SY
4030 PRINT #3, "      CALL SYMBL("+FRMT$(X,5,2)+","+FRMT$(Y,5,2)+","+FRMT$(SY,2)+")"
4040 GOTO 100
5000 ! PLOT AXIS
5010 INPUT "AXIS LENGTH IN INCHES ";AL
5020 INPUT "ORIENTATION (0=X, 1=Y) ";AO
5030 INPUT "ENTER AXIS LABEL ";LA$
5040 LL=LEN(LA$)
5050 PRINT #3, "      CALL FAXIS(1.0,1.0,"+FRMT$(AL,4,1)+",";
5051 PRINT #3, FRMT$(AO,1)+","+FRMT$(LL,2)+"H"+LA$+","+FRMT$(LL,2)+")"
5052 PRINT #3, "      CALL LABEL(1.0,1.0,"+FRMT$(AL,4,1)+",";
5053 PRINT #3, FRMT$(AO,1)+",";
5054 IF AO=0 THEN PRINT #3, FRMT$(XO,6,3)+","+FRMT$(XI,6,3)+")"
5055 IF AO=1 THEN PRINT #3, FRMT$(YO,6,3)+","+FRMT$(YI,6,3)+")"
5060 GOTO 100
6000 ! CLOSE PLOT
6005 INPUT "NUMBER OF COPIES ";NC
6007 IF NC>1 THEN PRINT #3, "      CALL SETCOP("+FRMT$(NC,1)+")"
6010 PRINT #3, "      CALL VCLOSE(I)"
6020 PRINT #3, "      PRINT (5,999) I"
6030 PRINT #3, "  999 FORMAT(1H ,I6)"
6035 PRINT #3, "      END"
6040 CLOSE 3
6050 OPEN #3, NA$+".CMD/WR"
6060 PRINT #3, NA$+"="+NA$
6070 PRINT #3, "LB:[1,10]DATAPLF4P.OLB/LB"
6080 PRINT #3, "LB:[1,1]F4POTS.OLB/LB"
6090 PRINT #3, "/"
6100 PRINT #3, "LIBR=F4PRES:RO"
6110 PRINT #3, "//"
6120 EXIT
