The user of BASIC IAS/RSX may wish to produce formatted plots on a Tektronix 4014 terminal. To do this, one may either incorporate the plotting subroutines(LB1:[377,377]PLOTIO.BAS) into the user's program(if it is short enough), CHAIN to PLOTIO.BAS (giving it a line number to return to), or create a plot file with one program and plot it out using the Utility Program GRAPH.BAS(on LB:[377,377]). GRAPH.BAS is an interactive program capable of displaying up to 10 plots at a time on a 4014 terminal. Commands are of two types, the immediate execution command which either sets up the plot common area or starts the plot going, or the 'special' command which does not execute until the plot is completed. The special commands are COPY, PAGE, and HALT. Each of these commands waits until the current plot is executing before it executes. Before GRAPH starts plotting it erases the terminal screen. It also erases the screen before returning to command input mode (after a plot is done). Hence, if one wishes to get a copy, one had best use the copy command. Additional HELP may be obtained by typing HELP BASIC GRAPH keyword, where keyword is one of CREATE Create a plot file for GRAPH COMMANDS The GRAPH interpreter command list. 3 CREATE The plot file is created as a virtual array file with the commands DIM #n, C(1019) OPEN "filespecifier" as FILE #n within one's BASIC program. For detailed information on plot file format type HELP BASIC PLOT, 3 COMMANDS ADD ADD data to data set BYE Logoff from BASIC CHAIN prog CHAIN to another BASIC program CLOSE Declare the open data set closed COPY Make Hard Copy when done.(special command) DATA Declare the name of the data set(plot file) DELETE Delete Points from the data set HALT Stops the program after the most recent plot(for debugging) OPEN Declare the data set number in use PAGE Erase screen(special command) PLOT Stop accepting commands, go execute plot POINT Set the type of point plot. LINE Set the type of line plot. LIST List out the data in the plot file RUN prog Run another BASIC program STOP Stop running GRAPH and return to BASIC monitor TITLE Set X and Y titles VIEWPORT Set the data and axis ranges WINDOW Set the area of the terminal screen to plot on For further HELP on any of the above commands type HELP BASIC GRAPH 'commandname' where 'commandname' is any of the above names. 3 OPEN OPEN (n) From 1 to 10 plot files may be plotted at a time. The OPEN command assigns a number to each plot file. Operation on plot files starts on file #1 and proceeds sequentially to file #10. The open command must preceed the DATA command. No actual plotting takes place until the PLOT command is issued at which time GRAPH calls PLOTIO.BAS to execute the commands for as many of the 10 plot files as are in use. EXAMPLE: OPEN (1) 3 CLOSE CLOSE (n) After a command sequence on a plot file is over, the file must be closed. Then and only then can a new file be opened and a command sequence to it be started. EXAMPLE: CLOSE (n) 3 CHAIN "prog" From GRAPH one can chain to another BASIC program and return back into GRAPH provided the correct common blocks are observed. Type HELP BASIC PLOT COMMON for more information. 3 DATA DATA filespecifier Before a file may be plotted, it firs must be defined. The DATA command assings the file name containing the data to be plotted. Warning, if the name typed in does not exist a fatal error will occur and GRAPH will stop. BASIC has almost no error recovery. EXAMPLE: DATA DK!:TEST.DAT;1 3 PLOT After all commands for all data sets have been entered, the PLOT command will start GRAPH/PLOTIO to executing these commands sequentially. After the last command on the last file is done, GRAPH will return to input mode and accept more commands. 3 POINT POINT #N Each plot file has within it the type of symbol to plot it out with. If this command is never issued it is assumed that a line plot is desired (C(9)=0). If it is issued, the type of symbol specified(0-3) stays with the plotfile thereafter. 3 LINE LINE #N Each plot file has within it the type of line to draw on the terminal. By default this value should be set=1(line plot). Line plots may be disabled by setting LINE #0. Type HELP BASIC PLOT LINE_TYPE for information on the values N may take for line plots. EXAMPLE: LINE #1 3 WINDOW WINDOW(xmin,xmax,ymin,ymax) For defining the graphics terminal window(area of screen), all corrdinate values are taken to be in Screen Units(0 < x < 1023, 0 < y <780 ). Data on a plot file is never plotted outside of the window. 3 VIEWPORT VIEWPORT(Xmin,Xmax,Xint,Xtics,Ymin,Ymax,Yint,Ytics) Xmin,Ymin minimum value on axix Xmax,Ymax maximum value on axis Xint,Yint axis value ot which the orthogonal axis intersect Xtics,Ytics if > 0 # tics on axis and linear plot If < 0 # of cycles of log axis. Data outside the range of the viewport will not be plotted. Data a factor of 30 outside the viewport will produce overflow errors. EXAMPLE: VIEWPORT(-5,10,0,3,1,1000,10,-3) Here the X-axis runs from -5 to 10 with three divisions. The Y-axis instesects the X-axis at X=0. Tye Y-Axis is logarythmic from 1-1000 with three cycles. The X-axis intersects the Y-axis at Y=10. 3 TITLE The TITLE command allows the user to specify an X-title and a Y-title for each axis of each graph. The titles 'evaporate' if you ever exit GRAPH. After typing in "TITLE", the program responds with "X-TITLE and then prompts for input. Then it prints Y-TITLE and promts for more input. 3 LIST LIST, LIST(N1,N2) To examine the plot file, the number of points, the viewport and the window, and the data itself is displayed by typing LIST. This will list all data in array C(1019). To get a list of just a section of the data from X-Y pairs N1 to N2, type LIST (N1,N2). 3 DELETE DELETE After a plot file is opened, the user may specify that after plotting, an unspecified # of points should be deleted. After the plotting is done, (using a point plot helps), the graphic cross hair is displayed. Center it over a pint and hit any key and the point is removed from the data set. (forever). If the key "S" is hit, deleting points stops with the last point entered, otherwise deleting points continues unless the "RETURN" key is hit in which case no point is deleted. EXAMPLE: OPEN (1) open data set 1 DATA DK1:TEST.DAT use this plot file POINT #1 do a point plot DELETE set up for deleting after plot CLOSE (1) close OPEN (2) now use the same file over DATA DK1:TEST.DAT and replot it PAGE Erace screen PLOT Display new plot **** warning this routine has a few bugs 3 ADD ADD i The ADD command is the exact opposite in effect to the DELETE command. With it points can be added to the data set. *********warning it does not always work well. 3 STOP STOP When this command is executed the program will stop execution and return to the BASIC monitor. 3 COPY When this special command is executed, a Hardcopy of the display (graph) will be made. 3 BYE BYE exits the user from GRAPH and BASIC. 3 HALT HALT is used in debugging PLOTIO. PLOTIO stops after plotting the graph rather chaining bach to GRAPH.