PLOTA PLOTA is a generalized histogram plotter or scatter plot generator. It will (eventually) be able to plot to any graphics device. Initial version plots on LXY11 printer and HP plotter. If LUN 2 is assigned to a terminal, PLOTA will plot to the HP plotter. Otherwise it will plot to the LXY11 printer. To call it from FORTRAN use the following call and link your program with [1,1]PLOTA/LB and [1,1]PLTUSL/LB. CALL PLOTA(INIT,IBOX,ILIM,ITIX,IPAR,ITLE,ISYM) WHERE THE FOLLOWING DIMENSIONS APPLY INTEGER*2 INIT(7),IBOX(4),ILIM(4),ITIX(2),IPAR(3),ITLE(2),ISYM REMEMBER!!!! CALL VTERAS after the last call to PLOTA to ensure the plots are properly closed. FORMAT OF THE ARRAYS: NOTE THAT THE DATA IS SOMETIMES BIT ENCODED. THE CONTENTS OF THE CONTROL ARRAYS ARE AS FOLLOWS: INIT(1) BITS 15-0 ARE AS FOLLOWS 15 ERASE/OVERPRINT 14 NEW PLOT/OLD PLOT (IF 1/IF 0) 13 ROUND YMAX,YMIN /NO ROUNDING 12 ROUND XMAX/XMIN/NO ROUNDING 11 FIND YMAX/GIVE YMAX 10 FIND YMIN/GIVE YMIN 9 FIND XMAX/GIVE XMAX 8 FIND XMIN/GIVE XMIN 7 DRAW X SCALE/NO X SCALE 6 DRAW Y SCALE/NO Y SCALE 5 PRINT PARAMETERS/NO PARAMETERS 4 PRINT TITLE/OMIT TITLE 3 PRINT X UNDER/OVERFLOW/NO OVER-UNDER-FLOW 2 PRINT Y OVER-UNDERFLOW/NO Y OVER-UNDERFLOW 1 UNUSED 0 INDEX ENTRY /NOT IN INDEX (UNUSED) SUGGESTED VALUE: "165320 INIT(2) BITS ARE AS FOLLOWS: 15 LOG/LINEAR 14 LARGE/SMALL LETTERS 13-12 UNUSED 11-9 DISPLAY MODE 0-ILLEGAL 1-HISTOGRAM 2-LINE GRAPH 3-SCATTERGRAM 4-SYMBOL PLOT 5-CORRELATION PLOT 6,7--ILLEGAL 8 UNUSED 7-6 ERROR DISPLAY 0-NO ERRORS 1-ERROR IS SQRT(Y) 2-ERROR IS VALUE IN ERROR ARRAY 3-ERROR IS SQRT(VALUE IN ERROR ARRAY) 5-3 STORAGE FORMAT 0-Y'S ONLY 1-(X,Y) PAIRS 2-X AND Y ARRAYS 3-ILLEGAL 4-(Y,ERROR) PAIRS 5-(X,Y,ERROR) TRIPLETS 6-X,Y, AND ERROR ARRAYS 7-ILLEGAL 2-1 UNUSED 0 DOUBLE WORD/SINGLE WORD (1 OR 0) SUGGESTED VALUE: "101000 for log, "1000 for linear scale INIT(3) IS THE NUMBER OF POINTS TO BE PLOTTED INIT(4) IS FIRST ADDRESS OF DATA BUFFER OF Y ARRAYS EXCEPT IN FORMATS 2 AND 6, WHER IT IS THE FIRST ADDRESS OF THE X ARRAYS INIT(5) IS THE FIRST ADDRESS OF Y ARRAY FOR FORMATS 2 AND 6. OTHERWISE IGNORED. INIT(6) IS THE FIRST ADDRESS OF THE ERROR ARRAY FOR STORAGE FORMAT 6. OTHERWISE IGNORED. INIT(7) IS COLOR INFORMATION (INTERNALLY PASSED IN GLOBAL "COLORS") TO CONTROL COLOR SELECTION IN VTINIT/VTMODE. THE BITS HAVE THE FOLLOWING MEANINGS: 3 SELECT NEW COLOR AND INITIALIZE HP PLOTTER 2-0 COLOR PEN NUMBER - 1 (PEN 1 IS 0, PEN 2 IS 1, ETC. NOTE BIT 3 IS MEANINGFUL ONLY FOR "OLD" PLOTS. UNLESS IT IS SET FOR AN OLD PLOT, A NEW COLOR WILL NOT BE SELECTED. IBOX(1)--DIMENSION OF GRAPH ALONG VT01 CRT IN RASTER UNITS (SCREEN IS 2048 BY 2048). SUGGESTED VALUE: 1700. IBOX(2)--HORIZONTAL OFFSET TO LOWER LEFT OF GRAPH. RECOMMENDED VALUE: 275. IBOX(3)--DIMENSION OF GRAPH VERTICALLY. SUGGESTED VALUE: 1700. IBOX(4)--VERTICAL OFFSET UP TO BOTTOM OF GRAPH. SUGGESTED VALUE: 200. ILIM(1) IS MAXIMUM X VALUE ON GRAPH ILIM(2) IS MINIMUM X VALUE ILIM(3) IS MAXIMUM Y VALUE ILIM(4) IS MINIMUM Y VALUE THESE APPLY ONLY IF BITS IN INIT(1) ARE SET TO CAUSE THEM TO BE USED. ITIX(1) IS THE NUMBER OF HORIZONTAL TIK MARKS ALONG BORDER ITIX(2) IS NUMBER OF VERTICAL TIK MARKS. (THESE ARE NUMBER OF XBINS OR YBINS FOR CORRELATION PLOTS.) IPAR(1) IS NUMBER OF PARAMETERS TO PRINT AT THE TOP OF THE GRAPH. IPAR(2) IS THE FIRST WORD OF PARAMETER WORD LIST. EACH IS 3 WORDS OF ASCII SOMEWHERE IPAR(3) IS FIRST ADDRESS OF THE PARAMETER VALUE LIST. NOTE THAT VALUES MUST BE INTEGERS. PLOTA DOES NOT UNDERSTAND FOCAL'S FLOATING-POINT NUMBERS. ITLE(1) IS NUMBER OF CHARACTERS IN TITLE ITLE(2) IS FIRST ADDRESS OF TITLE. (70 CHARS MAX.) ISYM IS AN ASCII SYMBOL USED IN SYMBOL PLOT. (TRY "53 [+]) NOTICE YOU MAY HAVE LINEAR/LOG PLOTS QUITE EASILY. AFTER THE LAST PLOT, CALL VTERAS TO CLOSE THE PLOT FILES AND CLEAN UP. THE CALL IS CALL VTERAS WITH NO ARGUMENTS. There are some FORTRAN callable entries available which also are able to plot to LXY11 or HP plotter. All routines visualize the plotting surface as a box as follows, 2048 units wide and 2048 units high corresponding to the "full page": 0,2048 +--------------------------+ 2048,2048 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 0,0 +--------------------------+ 2048,0 and will set appropriate "scale factors". The plot package uses Logical Unit 2 and if LUN 2 is assigned to a terminal type device, plots will be generated for the HP plotter. Otherwise, LXY11 plots will be produced. This is determined at runtime, so only a reassignment is needed to change from one to the other. FORTRAN callable entries are as follows: VTPLOT(ICODE,NX,NY) draws lines or points at NX,NY according to ICODE as follows: ICODE=1 Draw point at NX,NY ICODE=2 Draw line to NX,NY ICODE=4 NX,NY values are increments ICODE=8 Don't update X,Y positions when done. ICODE is bit encoded. Common area VTDATA may be used to give access to the X and Y values used. VTINIT(mode) Initializes plots. if the Erase bit is set in mode, will start new plots. The Erase bit is the 2 bit. VTERAS Ends plot. Should always be called at the end of plotting to clean up after the last plot. VTPPOS(IX,IY) Returns current X and Y locations. COLORH(ICOLOR) Sets plot color. Should be called with ICOLOR encoded as (color # -1) + 32 so the 32 bit will be set to flag a new color. Only effective for HP plots and ignored for PLXY11 output. CRTEXT(IX,IY,BUFFER,NBYTES,ISIZE) Plots text starting at IX,IY on the page. The BUFFER address is the start of the string of NBYTES characters. ISIZE encodes the size of the characters. The default size is 4 plot units per "dot" of the plot (a 5 by 7 format is assumed), but larger or smaller values are permitted. A zero will cause use of default size. VTLINE(IX1,IX2,IY1,IY2) Draw line from IX1,IY1 to IX2,IY2. Leaves pointer at IX2,IY2 (expressed in coordinates in the range 0-2048). VTMOVE(IX,IY) Move plot coordinates to IX,IY. Some device dependent routines for the HP plotter only are also present in PLOTA.OLB. They are as follows N=ISBN(NUMBER) Returns SBN packed form of NUMBER CALL IMBN(NUMBER,ADDRESS,NBYTES) Packs NUMBER into array at ADDRESS, returns NBYTES used. CALL IMBP(NUMX,NUMY,ADDRESS,NBYTES) Packs NUMX,NUMY as a multibyte pair starting at ADDRESS and returns NBYTES used.