The user of RSX/IAS BASIC can produce plots on Tektronix 4014 terminals by including a package of BASIC subroutines in the mainline of their program, setting up a graph array, and then calling subroutines in the graphing package. HELP on using this facility may be obtained by typing HELP BASIC PLOT 'keyword', where keyword is one of the following. ARRAY_MAP Description of the format of the virtual graph array. LINE_TYPE Setting the plot line type SUBROUTINES Description ot the various subroutines used. SYMBOL_TYPE Setting the plot symbol type VARIABLES Definition of the internal variables which must set up. 3 VARIABLES DEFINITIONS OF VARIABLES USED FOR GENERAL PLOT ROUTINES PLOTIO.BAS Set up a virtual array C(1019) to hold the graphic data. This array will hold a maximum of 500 X-Y pairs plus the axis and screen window data required for plotting. C(0) must be set to the number of points in the data set. DIM #1, C(1019) --- THE PLOT DATA ARRAY C(0) = # OF X-Y PAIRS SET UP GRAPHIC WINDOW(AREA OF 4014 TO PLOT ON) X0% = C(1) = LEFT EDGE OF PLOT AREA IN SCREEN UNITS(S.U.) X1% = C(2) = RIGHT EDGE OF PLOT AREA IN S.U. Y0% = C(11) = BOTTOM EDGE OF PLOT AREA IN S.U. Y1% = C(12) = TOP EDGE OF PLOT AREA IN S.U. SET UP X VIEWPORT(RANGE OF X VALUES TO PLOT) X2 = C(3) = MIN VALUE DISPLAYED ON X AXIS X3 = C(4) = MAX VALUE DISPLAYED ON X-AXIS X4 = C(5) = X-AXIS VALUE AT WHICH Y-AXIS INTERSECTS X5% = C(6) = # TIC MARKS ON AXIS IF X5%>0 LINEAR X-AXIS IS DRAWN IF X5%<0 LOG X-AXIS IS DRAWN X6%=LOCATION OF THE Y-AXIS IN S.U. SET UP Y VIEWPORT(RANGE OF Y VALUES TO PLOT) Y2 =C(13)=MIN VALUE DISPLAYED ON Y-AXIS Y3 =C(14)=MAX VALUE DISPLAYED ON Y-AXIS Y4 =C(15)=Y-AXIS VALUE AT WHICH X-AXIS INTERSECTS Y5%=C(16)=# TIC MARKS ON AXIS IF Y5%>0 LINEAR Y-AXIS IS DRAWN IF Y5%<0 LOG Y-AXIS IS DRAWN Y6%=LOCATION OF THE Y-AXIS IN S.U. Y7=C( ) ADDITIONAL PARAMETERS IN "C" ARRAY ONLY UP TO 500 (X,Y) PAIRS CAN BE PLOTTED C(8)>0 DEFINES LINE PLOT TYPE TO BE TO BE USED WITH THE 4014 C(9)>0 DEFINES A SYMPOL PLOT =1 DEFINES A POINT PLOT C(10),C(17)-C(19) REMAIN UNDEFINED(BUT RESERVED) 3 LINE_TYPE C(8) is the line type variable, it must be defined. For a normal plot it should be set =1. If the terminal supports the enhanced graphics option on the 4014, various other plot types may also be implemented. C(8) Z-axis Vector Type Terminal ________________________________________________ 1 normal solid All 4014 terminals 2 normal dotted Enhnaced Graphics terminals. 3 normal dot-dashed " " " 4 normal short dashed " " " 5 normal long dashed " " " 9 defocused solid All 4014 terminals 10 defocused dotted Enhanced Graphics terminals. 11 defocused dot-dashed " " " 12 defocused short dashed " " " 13 defocused long dashed " " " 17 writethrough solid All 4014 terminals 18 writethrough dotted Enhanced graphics terminals 19 writethrough dot dashed " " " 20 writethrough short dashed " " " 21 writethrough long dashed " " " 3 SYMBOL_TYPE C(9) defines the symbol plot type. C(9) may have a value of 1-3 only. C(9) symbol _________________ 1 ! . a period 2 ! + a plus or cross 3 ! ^_ a triangle 3 SUBROUTINES Any program wishing to use the plot subroutines should do so in the following sequence. 0. DEFINE FUNCTIONS............8100 1. JITTER THE AXIS AND CREATE X6% AND Y6%....GOSUB 8200 2. PLOT X-AXIS...........GOSUB 8300 3. PLOT Y-AXIS...........GOSUB 8400 4. NORMALIZE DATA........GOSUB 8500 5. GRAPH THE DATA........GOSUB 8600 6. DELETE DATA...........GOSUB 8900 (Used only by GRAPH) 7. ADD DATA..............GOSUB 8950 (Used only by GRAPH) (X,Y)PAIRS IN ARRRAY C, C(20)-C(1019) SUCH THAT X AND Y VALUES ALTERNATE C(20)=X(0),C(21)=Y(0) 3 ARRAY_MAP MAP OF THE "C" VIRTUAL ARRAY __________________________________________ ! C(0) = # OF X-Y PAIRS ! ------------------------------------------ ! C(1) = LEFT EDGE OF PLOT AREA(S.U.) ! ------------------------------------------ ! C(2) = RIGHT EDGE OF PLOT AREA(S.U.) ! ------------------------------------------ ! C(3) = MIN VALUE ON X-AXIS ! ------------------------------------------ ! C(5) = Y AXIS INTERSECTS X-AXIS AT ! ------------------------------------------ ! C(6) = # TIC MARKS & LOG/LIN FLAG ! ------------------------------------------ ! C(7) = UNDEFINED ! ------------------------------------------ ! C(8) = LINE PLOT TYPE ! ------------------------------------------ ! C(9) = POINT PLOT TYPE ! ------------------------------------------ ! C(10) = UNDEFINED ! ------------------------------------------ ! C(11) = BOT EDGE OF THE PLOT AREA(S.U.)! ------------------------------------------ ! C(12) = TOP EDGE OF THE PLOT AREA(S.U.)! ------------------------------------------ ! C(13) = MIN VALUE ON Y AXIS ! ------------------------------------------ ! C(14) = MAX VALUE ON Y AXIS ! ------------------------------------------ ! C(15) = X-AXIS INTERSECTS Y-AXIS AT ! ------------------------------------------ ! C(16) = # TIC MARKS & LIN/LOG FLAG ! ------------------------------------------ ! C(17) = UNDEFINED ! ------------------------------------------ ! C(18) = UNDEFINED ! ------------------------------------------ ! C(19) = UNDEFINED ! ========================================== ! C(20) = X(0) X OF 1ST (X,Y) PAIR ! .......................................... ! C(21) = Y(0) Y OF 1ST (X,Y) PAIR ! ------------------------------------------ ! C(22) = X(1) X OF 2ND (X,Y) PAIR ! .......................................... ! C(23) = Y(1) Y OF 2ND (X,Y) PAIR ! ------------------------------------------ ! " " " " " ! ! " " " " " ! ! " " " " " ! ------------------------------------------ ! C(1018) = X(500) LAST X OF (X,Y) PAIRS! .......................................... ! C(1019) = Y(500) LAST Y OF (X,Y) PAIRS! ------------------------------------------ 3 COMMON COMMON VARIABLES A COMMON AREA EXISTS WHICH ENABLES THE PASSING OF VARIABLES BETWEEN GRAPH AND PLOTIO. PROVISION IS ALSO MADE FOR THE AUTOMATIC INCLUSION OF COMMON VARIABLES WHICH A USER PROGRAM MIGHT NEED TO BE PASSING IN A CHAIN SEQUENCE. COMMON F$(10),X$(10),Y$(10),C$(10),R$(2) F$(J)---J=0,RESERVED J=1-10, NAMES OF PLOT FILES. IF F$(J)="",NO PLOT OCCURS X$(J)---J=0,RESERVED J=1-10, TITLE FOR X-AXIS Y$(J)---J=0,RESERVED J=1,10, TITLE FOR Y-AXIS C$(J)---J=0, RETURNS IN ASCII THE JITTER VALUE FOR THE AXIS. J=1-10, AT PRESENT 1 SPECIAL COMMAND IS ALLOWED PER PLOT FILE. R$(J)---J=0, ASCII VALUE OF LINE # TO BE CHAINED BACK TO. IF R$(0)="" THEN THE CHAIN GOES BACK TO THE START OF THE PROGRAM. J=1, THE NAME OF THE PROGRAM TO CHAIN BACK TO. IF R$(1)="", PLOTIO CHAINS BACK TO GRAPH. J=2, THE FILENAME FOR A USER DEFINABLE COMMON OVERLAY AREA. IF R$(2)="", THEN NO OVERLAY IS BROUGHT IN. THE OVERLAY LINES ARE XXX-YYY.