DataPlot User's Guide Version 2.1 - 30 November 1991 Table of Contents INTRODUCTION . . . . . . . . . . . 1 STARTUP. . . . . . . . . . . . . . 2 KEYBOARD OPERATION . . . . . . . . 3 STOP . . . . . . . . . . . . . . . 4 DATASETS . . . . . . . . . . . . . 5 OPTIONS. . . . . . . . . . . . . . 6 DEFAULT OPTION VALUES. . . . . . . 7 INTERACTIVE OPTIONS. . . . . . . . 8 FILE READING . . . . . . . . . . . 9 CROSSHAIRS . . . . . . . . . . . .10 FUNCTIONS. . . . . . . . . . . . .11 MACROS . . . . . . . . . . . . . .12 PRINTERPLOT. . . . . . . . . . . .13 PLOTTEXT and LEGEND. . . . . . . .14 RESCALE and REPLOT . . . . . . . .15 SKETCH FREEHAND. . . . . . . . . .16 HPGL and PLT:. . . . . . . . . . .17 DRAWFUNCTION . . . . . . . . . . .18 SCREENPRINT. . . . . . . . . . . .19 GRAPHICDUMP. . . . . . . . . . . .20 SAMPLE FILES . . . . . . . . . . .21 THE END. . . . . . . . . . . . . .22 1. INTRODUCTION DataPlot2.1 makes 2-dimensional plots of data on the screen and on dot matrix printers which are Epson MX-80 compatible. Hard copy plots can also be made in the Hewlett-Packard Graphics Language for driving pen plotters. If the PLT: driver is installed, then the output can be to any preferences supported dot matrix printer. Screen plots can be made at any resolution, and may range in size from 200 x 100 pixels to full screen. Screen prints are transferred to paper on a pixel to pixel basis. Variable size paper plots can be made to dot matrix printers, with the plots ranging from 4.5 to about 18 cm on a side. Up to 100 sets of data may be plotted on one screen. Up to 2 billion points can be in each data file, although it would take an unreasonably long time to plot that many points. Each file may have from 1 to 50 columns of numbers. Plots can be saved as IFF files. There is also a macro language for repetitively plotting datasets using the same options. The macro language makes it possibe to use other programs to generate the macro files for visual analysis of datasets. DataPlot2.1 is easy to use. It may be run from either WorkBench or the CLI. Many items can be selected from the mouse menu. Nearly all options may be set by clicking on them from the options screen. The keyboard may be used to select several of the mouse menu commands. These single key shortcuts are listed below under KEYBOARD OPERATION. At least one megabyte of ram is required. The stack size required is 10000. The DataPlot2.1 icon contains that number so that the stack is automatically set when run from WorkBench. CLI users should use the STACK 10000 command before running DataPlot2.1. 2. STARTUP Start up DataPlot2.1 by typing the name from a shell or CLI, or from WorkBench by double clicking on the icon. DataPlot2.1 will not use the information located in the icon for a project. Therefore you may not click on a dataset or macro file icon and then shift - double click on the DataPlot2.1 icon. DataPlot2.1 uses four system libraries. In order to use them, four special files, dos.bmap, exec.bmap, graphics.bmap, and intuition.bmap, are necessary. They are included on the Extras 1.3 disk. If they are not found in the LIBS: directory or in t:, then a short version will be created in t: and deleted as the program ends. A point-and-click file name requester is available when reading a file. Selecting the Requester box or pressing F8 calls up the file requester. If arp.library is in libs: and BatchRequester is in c:, then the ARP file requester, which is faster than the built-in one, will be used. Otherwise, a built-in requester will be used which starts at the top level of disk drives and assigned directories. Clicking on a file name selects that file for reading by DataPlot2.1. A file name can be entered from the keyboard by clicking on the "File:" word at the top of the requester window. Pressing ENTER ends the entry. All ".info" files are eliminated from the requester. The list of files is sorted without regard to case. Clicking on a directory name results in a display of subdirectories and files. The path is shown in the second line of the requestor. If there are no files from which to choose, then the display will indicate that and you may select cancel or parent directory from the bottom of the requester. Upon start up, DataPlot2.1 sets up the default options (as stated below) and opens a custom 640 x 200 pixel, 4-color screen. Selecting the "Plot a dataset" menu item will bring up a file name request window. The specified file will be read to determine any options to be applied, such as which column is X and which is Y. Options contained in the dataset file will override options set from the keyboard, unless USE NO is set, meaning that DataPlot2.1 is not to use any of the in-file options. After reading the options, the file will be read again to obtain the data. Automatic scaling information is determined from the first file to be read which actually contains any data points. A file could have only options and no data, if desired. After the scaling is performed, the file is read again and each point is plotted. Therefore, KYBD: may not be used as a data file name. Except for PrinterPlot to Preferences, all output to a printer goes to a "PrinterPort", an internal varible in DataPlot2.1 that may be an actual port, such as PAR:, or it may be a file name. During interactive use, DataPlot2.1 will request the PrinterPort name from the user before printing. During execution of a macro the output device should be selected with the PrinterPort xxxxxx command. The default for ScreenPrint and for PrinterPlot Epson is the parallel port, PAR:. The plot can be transferred to paper by selecting the menu item "ScreenPrint" or "PrinterPlot". The "ScreenPrint" selection will make a screen pixel to printer pixel copy of the plot. The "PrinterPlot" selection will read the data files again and make a plot at the size specified. The Y-axis label will be printed horizontally at the top of the Y-axis in the PrinterPlot Epson mode. Plots can be made to any preferences supported printer by selecting PrinterPlot to Preferences. This will result in a reconstruction of the plot in the Hewlett-Packard Grahpics Language (HPGL) with the output directed to the PLT: device, which should have been installed first (by MOUNTing PLT: and ASSIGNing PLTDATA: to whichever directory contains the HPGL fonts). The same thing can be accomplished by selecting PrinterPlot HPGL with the output (selected by the macro command PrinterPort PLT:) with the output appearing at the printer. For computers with insufficient RAM, the user could first send the PrinterPlot HPGL output to a file, exit DataPlot, then copy the file to PLT:. The PLT: device program will rasterize the HPGL output and send it to the printer or to a high resolution screen. If the DataPlot output is to a file, an ASCII file of HPGL commands will be created. That file may be copied to PLT: for a printer plot. If you copy the file to PLT:S, then the plot will be drawn on a high-resolution screen, giving a preview of the printer plot. A paper copy can also be made by selecting GraphicDump, which uses the screen printing facility that comes with WorkBench1.3. This is discussed in more detail later. 3. KEYBOARD OPERATION In addition to using the mouse to select operations to be performed, you may enter the characters shown in parentheses in the pull-down mouse menus and shown here to activate the indicated commands: Help (Help key) New Plot (N) Plot a Dataset (D) Draw a Function (F) Execute a Macro (M) Save as IFF file (F1) Save as a Macro (F2) Crosshairs (C) Rescale & Replot (R) Plot text (T) Legend (L) Sketch Freehand (S) Set an Option (O) Quit (Q) Printer Plot to Preferences Printer (P) Screen Print to Epson compatible printer (F3) Printer Plot to Epson compatible printer (F4) Printer Plot to HPGL output (F5) Screen Dump to Preferences Printer (F6) Case is insignificant. The left and right arrow keys may be used to position the cursor when entering a value from the keyboard. Some requestor boxes include boxes to erase, accept (OK), and cancel the operation with the mouse. Whether these boxes are shown or not, certain keys may be used as follows: Erase the entry F9, control-X, or control-U Cancel the operation ESCape Accept the entry F10 or ENTER These functions are available by clicking the mouse in the appropriately named box. The cursor can be positioned in the entry by use of the mouse and the cursor arrow keys. 4. STOP An operation, such as plotting a curve or printing a plot may be halted with a control-C. The screen will flash and beep, then after the current point or line is processed, the operation will be aborted. Two control-C's within one second will result in a requester box asking whether to terminate the DataPlot program. 5. DATASETS A data file consists of any number of option lines followed by the data points. Each line of data consists of from 1 to 50 data values separated by a comma or spaces or both a comma and spaces. Every line of data must have the same number of columns of data. By default, the first column of data contains the X axis values, and the second column contains the Y axis values. The options XCOLUMN=n and YCOLUMN=n (where n may range from 1 to 50) may be used to specify which columns of data are to be plotted. If the data consists of only one column of values, then the option "DATATYPE = UNIFORM" may be used, which also sets YCOLUMN=1. A subsequent YCOLUMN option could be used to change this default value. DataPlot2.1 will then read only the Y values from the file, with the X values starting at 1 and incremented by 1 with each point. The program detects the start of numeric data following option lines (which may be blank lines) when the first non-blank character is numeric, meaning the digits 0-9, +, -, or a decimal point. The first several lines of data may be skipped by setting the option SkipPoints=n. Data is normally read until an end of file is reached. If the entire file is not to be read, then the option MaxPoints=n can be used to specify how many points to read. Reading will also stop if the end of the file is detected. The data file may also consist of just one column if the Xcolumn=1 and Ycolumn=1 options are used. With only these options, the plot would simply be a straight line. Using the FUNCTION options, one could plot a number of different curves using that same file as the input dataset. A data file may consist of only options. If the same set of options are always used, you may wish to make a file containing just them. Such a file could be named MACRO.AUTO and placed in the default directory. It would then be executed automatically whenever DataPlot2.1 is run from that directory. Another choice is to create a macro file DataPlot.init in the S: directory, and it will also be executed automatically when DataPlot2.1 is run. DataPlot.init might have your choice of colors, for instance, or perhaps your choice of screen resolution and depth. Your type of printer could be specified in DataPlot.init using the command PRINTERTYPE EPSONQ, for instance. It could simply speak to tell you that DataPlot2.1 is ready for commands. To save time when plotting a very large dataset with known minima and maxima, one could set the proper limits with the XMINIMUM, XMAXIMUM, YMINIMUM, and YMAXIMUM options. If a minimum or maximum value is set, then the specified value will be used for autoscaling, with the other values obtained from the first dataset. For manual scaling, one must also set SCALE=MANUAL, and supply XSTEPS and YSTEPS. (The default number of steps is 5). With manual scaling, the user is responsible for selecting values that will result in numerics with a nice appearance. 6. OPTIONS An option line consists of an option name, which is always just one word, followed by an equal sign or a space and an option value. The spelling of the option may be truncated, but should be long enough that it will not be ambiguous. Upper case is not required. An unrecognized option in a data file is just ignored and the processing continues. The option PRINTOPTIONS will result in an output to the currently specified PRINTERPORT of the current values of the options, which are: TITLE = text (Text for plot title) XLABEL = text (Text for X axis label) YLABEL = text (Text for Y axis label) MARKERS = YES or NO (Draw a marker for each data point, YES 0 - 10 increments the marker number, else use the indicated marker) SEGMENTS = YES or NO (Draw line segments between data points, 0 - 10 use the selected line pattern, 0 is none, 1 is a solid line, others are dashed) XCOLUMN = 1 thru 50 (Selects the column with the x values) YCOLUMN = 1 thru 50 (Selects the column with the y values) ZCOLUMN = 1 thru 50 (Selects the column with the z values for use with a function) ErrorColumn = 1 thru 50 (Selects the column with the error values, an error bar will be drawn) REMARK text (Ignore this comment line) ;text (Ignore this comment line also) DATATYPE = X,Y or UNIFORM (Data is X,Y or just uniformly spaced Y. The y column is set to 1, but may be changed by a subsequent YCOLUMN command.) SkipPoints N (Skip the first N points) MaxPoints N (Plot only N points) PrinterType EPSON (Sets the escape code for dots/lf, Epson MX-80 uses ESC A 8) or IBM (Uses ESC A 8 ESC 2) or EPSONQ (Uses ESC + 40 for 40/360 inch lf) NEWPAGE (Eject page when finished with plot) NOTE text (Notes will be printed below the plot for Epson printer plots) YFUNCTION algebraic-expression (Applies to the y-axis) XFUNCTION algebraic-expression (Applies to the x-axis) FUNCTION algebraic-expression (A function to be applied to the y-axis values, including the following:) SIN (Sine, angle in radians for all functions) COS (Cosine) TAN (Tangent) ASIN (Arcsine) ACOS (Arccosine) ATAN (Arctangent) SINH (Hyberbolic sine) COSH (Hyberbolic cosine) TANH (Hyberbolic tangent EXP (e raised to the value) LOG (Log to base 10) LN (Natural log) SQRT (Square root) ABS (Absolute value) INT (Integer part) FRAC (Fractional part) ^ (Exponentiation) ** (Exponentiation) X (The value read from the X-column) Y (The value read from the Y-column) Z (The value read from the Z-column) DATE (YYMMDD to YY.fraction) A blank expression erases the function; the variable is plotted. The following options may NOT be changed after the scaling values have been calculated and the plot box has been drawn: SCALE = MANUAL or AUTO (Manual or automatic scaling) XMINIMUM = value (Minimum X value for scaling) XMAXIMUM = value (Maximum X value for scaling) XSTEPS = 1-30 (Number of x steps for scaling) YMINIMUM = value (Minimum Y value for scaling) YMAXIMUM = value (Maximum Y value for scaling) YSTEPS = 1-30 (Number of y steps for scaling) XAXIS = LINEAR or LOGARITHMIC (X axis type) YAXIS = LINEAR or LOGARITHMIC (Y axis type) NUMERICS = YES or NO (Print numbers along the grid axes) MAJORTICKS = YES or NO (Draw major ticks, no grid lines) GRIDS = YES or NO (Draw grid lines, no major ticks) MINORGRIDS = YES or NO (Draw minor grid lines for log axes) GridTint = N (Selects the color for the grid lines, the default is 1) GRIDPATTERN DASHED or SOLID (Selects the grid line pattern) YLABELSIZE = 2 or 1 (Sets Y label height for sideways printing, because the pixels not square. The default is 2.) Some options are primarily for use with macros or from the keyboard by the user while running DataPlot2.1: HELP (Type this information to the screen) RESET (Reset options to default values, may only be used after a NewPlot command, and does not affect colors) VOICE male or female (Default is male) ChangeDirectory, CD, or CHDIR newdirectory (Change the default directory from which files will be read. Using "CD ." in a macro means to change to the directory in which the macro is located.) EpsonResolution 480 or 960 (The graphics mode for screen printing. Prints in the 960 mode are just half the size of the 480 mode prints. If a plot will not fit on the page in the 480 mode, then the mode will automatically be changed to 960 for that plot.) LaserJetResolution 75, 150 or 300 (Size and resolution of screen print) ScreenResolution 320x200 (Sets screen resolution, then executes or 640x200 a NewPlot. If there is insufficient or 320x400 RAM, then screen depth or resolution or 640x400 will be reduced automatically.) ScreenDepth 1-5 (Determines number of colors, 2^ScreenDepth, only after a NEWPLOT, default value is 2.) CurveColor 1-31 [r,g,b] (Select the color for the curve, can not exceed (2^ScreenDepth)-1. The [red, green, blue] values are optional.) ColorPalette color,r,g,b (Set the RGB values for a color, 0-31 with the red, green, and blue values ranging from 0 to 15. Color 0 is the background, 1 is for text and the grid, and higher colors are for curves.) WindowSize 200,100 to 617,386 (Set window size, can be done with or 297,186 mouse before the first dataset is plotted.) OnError WAIT, EXIT, or CONTINUE (Determines whether macro execution stops, DataPlot exits, or action continues on an error) 7. DEFAULT OPTION VALUES The default options are reset when a new plot is begun. These are: Title = DATA PLOT TitlePosition = TOP Xlabel = X Ylabel = Y Scale = auto Xdirection = forward Ydirection = forward Xaxis = linear Yaxis = linear Numerics = yes Grids = yes MajorTicks = no Newpage = no Orientation = landscape Printer = Epson PrinterPort = PAR: EpsonResolution = 480 LaserJetResolution = 75 Ylabelsize = 2 If scale = manual is invoked, then the six following default values are set, but may be changed. Xminimum = 0 Xmaximum = 10 Xsteps = 5 Yminimum = 0 Ymaximum = 10 Ysteps = 5 After a dataset is plotted, the following options are reset for the next file: DataType X,Y Markers yes (Incremented to the next marker type; there are 10) Segments yes (1 - solid line) SkipPoints 0 MaxPoints 2000000000 Xcolumn 1 Ycolumn 2 Zcolumn 0 ErrorColumn 0 Xfunction clear Yfunction clear The following default options can be set to your choice of values if they are included in your S:DataPlot.init file. Then whenever a NewPlot command is invoked, these options will be set as they are in your initialization file rather than as stated above. The initialization defaults can only be set for these options: Grids YES or NO (YES will set MajorTicks = NO) MajorTicks NO or Yes (YES will set Grids = NO) TitlePosition TOP or BOTTOM Yorientation SIDEWAYS or VERTICAL GridPattern DASHED or SOLID 8. INTERACTIVE OPTIONS During interactive use of DataPlot2.1, the options screen may be activated by either typing the letter O from the keyboard or by selecting Show and Set Options from the Options mouse menu. These options may be selected by clicking with the mouse. All options can also be set from the keyboard by just typing the name of the option and the value. An area at the bottom of the screen will be cleared and your entry will appear there. Clicking on the Other Option keyword will also result in a prompt for a keyboard entry of an option. An ESCape or mouse click in the appropriate box will end the setting of options. Clicking on an option which has only two or three valid values will automatically change the option to another valid value. Clicking on a string option, such as the TITLE, will allow the user to edit the current title. Clicking on one of the functions will allow the user to edit the last entered function, even if it contained an error and was not currently displayed on the screen. Clicking on the MARKER option will cause all ten markers to be displayed. A marker is then selected by clicking on it. To turn markers off, simply click on the word NONE. Clicking on the SEGMENTS option will result in a display of all ten SEGMENT types. A mouse click on the desired type will select it. The MARKER or SEGMENT type may be selected by number in a DataPlot2.1 macro. (Note: There are only six HPGL segment types.) Certain options, such as axis directions, can only be set before a file is plotted or a function is drawn. Thus, when setting new options for the next dataset, only those options which can be changed will be presented. 9. FILE READING DataPlot2.1 reads each file to be plotted several times. The first time is to activate any options that may be included in the file. The second time, the file is reopened, the option lines are skipped, and the data are read. If autoscaling is in effect, then the first data file may be read an additonal time to determine the minimum and maximum values. The file will not be read to determine the minimum and maximum values if they have been set by the appropriate options. If a paper plot is made, then the file is read another two times to replot the data to a bitmap. Therefore, KYBD: may not be used as a file name. 10. CROSSHAIRS When the CrossHairs mode is selected from the mouse menu, a small set of crosshairs will appear on the screen outside the plot area, and the pointer will be different. Clicking the mouse inside the plotting area will result in the crosshairs being drawn at the selected point and the corresponding values of X and Y appearing in the title bar. To exit this mode, click the mouse outside the plotting area, or press a key. 11. FUNCTIONS DataPlot can do manipulation of the data points with the FUNCTION options. For instance the functions (abs(1.56-tan(y)))^.5 or sqrt(x^2 + y^2) + (cos(x))^2 could be used. Specifying either FUNCTION or YFUNCTION specifies an operation on the Y-axis values of the plot, whereas XFUNCTION specifies an operation on the X-axis values. The functions are applied to the x and y values as read from the dataset file. The following function can be used to convert from a six or eight digit date in the format YYMMDD to a year + approximate fractional year format for plotting, and may be invoked by specifying the DATE keyword: int(x/10000)+int(frac(x/10000)*100-1)/12+int(frac(x/100)*100-1)/365 The functions can be used to convert data from metric to English units prior to plotting, for example. The function will be compiled and optimized to the extent that successive operations using constants will be evaluated at compile time. 12. MACROS DataPlot2.1 has a macro language which is useful for repeating plots. This macro language consists of all the options previously discussed, plus the following commands. Case is not significant, and commands may be truncated to three or more characters. In some cases you must use more than three characters to resolve an ambiguity that truncation would cause. For instance, using DAT UNIFORM in a macro would indicate that a DATASET named UNIFORM should be plotted. Whereas to specify that the data is of type uniform, the proper command would be DATATYPE UNIFORM, which could be truncated to DATAT UNI. The word PRINT is ambiguous also and should be extended. The macro commands are: NEWPLOT (Clear screen for new plot) DATASET filename (Plot this dataset) DRAWFUNCTION expression [,xmin,xmax,speed] (Draw this function from xmin to xmax at speed) RESCALE [Xmin,Xmax,Ymin,Ymax] (Auto rescale and replot) CROSSHAIRS (Start interactive crosshairs) PRINTSCREEN or SCREENPRINT Epson, Epson2x, LaserJet (Copy the screen to the dot matrix printer on a pixel to pixel basis.) GRAPHICDUMP (Print the screen to your Preferences selected printer using your Preferences selected options.) PRINTERPORT port (PAR: is the default port, could be a file name) PAUSE message (Prints message, waits for key or mouse) BEEP (Beeps) SPEAK message (Speaks the message) PLOTTEXT "text" colornumber [,xval,yval] (Places text on the plot) LEGEND "text" [colornumber, xval, yval, linetype, markertype] (Places a short line segment and the text on the plot. Optionally, one may specify the line type and marker type. All options except the text (which could be "") may be left off.) PRINTERPLOT Epson, Epson2x [width, height, left margin] (Makes a dot-matrix paper plot in portrait orientation only, with the 2x indicating double strike. [Optionally, one may specify width and height in cm, and left margin in character spaces.]) PRINTERPLOT HPGL (Makes a paper plot in the HP Graphics Language) PRINTERPLOT PREFERENCES (Makes a paper plot to the preferences selected dot matrix printer through the PLT: software) PRINTERADVANCE TOP or NNN (advance printer to top of form, or advance printer NNN lines) PRINTFILE filename (copy file "filename" to the printer) PRINTLINE text (copy the line of text to the printer) IFFSAVE iffname (Save screen as IFF ILBM file, about 41K free space is required) OnError WAIT, EXIT, or CONTINUE (Macro error response, WAIT waits for the user, EXIT terminates DataPlot2.1, CONTINUE ignores the error) USE YES or NO (Use or ignore the options included in a dataset.) DrawLine x1,y1,x2,y2[,LineType,MarkerType,CurveColor] (Draws a line from point (x1,y1) to point (x2,y2) with optionally specified CurveColor, LineType, MarkerType, and CurveColor. Two consecutive commas may be used to skip a field.) QUIT (Quit DataPlot2.1) An unrecognized macro command will be executed as an option. Error handling can be specified for macro file execution. If OnERROR WAIT has been set (the default) then execution of the macro will stop with an error message and wait for user intervention, which can be to exit the macro or to continue. If OnERROR EXIT has been set, then DataPlot2.1 will terminate on an error. If OnERROR CONTINUE has been specified, then the error will be ignored and execution of the macro will continue with the next command. The 2x suffix for Epson printer plots makes a double strike to make the print darker. For interactive selection, a question mark (?) may be used for a command or for a command argument. The user will be prompted for the argument to be used (e.g. DATASET ?). A user supplied default value may be entered following the question mark, as in these two examples: DataSet ? data1 (The user must select a dataset, data1 is provided as the default) ? screenprint (The user must select a command, screenprint is the default) If there is a file named DataPlot.init in the S: directory, then it will be executed upon startup. Such a file could have your choice of screen colors or depth. Then if there is a MACRO.AUTO file in the default directory, it too will be executed. Even though DataPlot2.1 does not have an AREXX port, it can be controlled by a script file though the MACRO.AUTO file. An automated system could collect data from a data acquisition system, write an appropriate MACRO.AUTO file, then run DataPlot2.1 to generate a printer plot. A plot can be saved as a macro, which is an ASCII file that can be edited by MicroEmacs, for example. The commands NewPlot and ScreenResolution are not included when a macro is saved, and must be added by the user, if desired. The NewPlot command will erase any macro commands presently in the history buffer. 13. PRINTERPLOT Plots can be transferred to a printer though several different commands. You can use the built-in ScreenPrint command to copy screen pixels to printer pixels. These ScreenPrints can look quite nice, but are rather slow. Section 19 has more details on the ScreenPrint function. You may also use the Graphic Dump routine supplied with the Amiga. If you select this mode from the DataPlot mouse menu, then only the active area of the screen will be printed. The title bar and window border will not be printed. You may also choose to output the plot to an HPGL file, which can be copied to a plotter. An HPGL file can also be copied to the PLT: device for translation and printing on your Preferences supported graphics printer. The PLT: device is quick, and has an excellent appearance. The line types (selected with the SEGMENTS nn command) vary from their appearance in screen plots. Yet another method is to have DataPlot2.1 make a bit map of the plot at your choice of size, which is then sent to your printer or to a file for later printing. This is done through the mouse menu PrinterPlot Epson command. This paper plot can print the Y axis label vertically, but cannot print it sideways. If YOrientation Sideways has been selected, the Y axis label will be printed horizontally above the Y axis values. Also, the PrinterPlot Epson paper plots can only be printed in Portrait mode. The default output port is PAR:, but it can be set by using the PrinterPort xxx command to specify any output destination, such as SER: or a disk file (for printing later). The PrinterPort should not be specified as PRT: for a printer plot because the Amiga Operating System will not pass the escape sequences to the printer as required for bit-mapped graphics. If NULL: is specified as the PrinterPort, then no output will be sent to the printer. This is internal to DataPlot2.1 and does not require a NULL: device driver. 14. PLOTTEXT and LEGEND Text can be positioned on a plot with these commands. After the user selects these mouse menu commands, the text color can be selected with a mouse click, and then the text may be typed in. Next, the text may be positioned on the plot by moving the mouse and clicking at the desired location. If the LEGEND command is selected instead of PlotText, then a short (32 pixel) line will be drawn to left of the user entered text. The last used line type (selected with the SEGMENTS nn option) and the last used marker type (selected with the MARKERS nn option) will be used. When used in a macro, the formats are: PlotText "the text" textcolor xpos,ypos Legend "the text" [,textcolor,xpos,ypos,linetype,markertype] where the desired text must be in quotes if it is more than one word. The arguments may be separated by commas or spaces at the user's option. The x and y positions are given in the scale coordinates (the values printed along the axes). A warning note will appear briefly on screen if the position is out of range. If the text color, an integer from 1 to 31, is greater than that allowed by the current screen depth, then it will be set to the maximum number permitted. For the Legend command, the linetype and markertype may be specified if desired. A linetype may be specified without specifying a markertype. A markertype may be specified without specifying a linetype by leaving the linetype blank by placing two commas together. All of the parameters may be left blank, even the text, in which case the new legend will appear just under the most recently printed legend, using the most recently used, or set, values for text color, line type, and marker type. The first legend should be placed high enough on the plot that all legends will fit. If the location of the first legend is not specified, then it will be placed near the upper left corner of the plot. If you wish to interactively add legends after the data has been plotted, then you will need to use the options screen to select the correct line type (with the SEGMENTS option), the correct marker type, and possibly the correct color before invoking the LEGEND command. 15. RESCALE and REPLOT This command is useful when multiple datasets are plotted on one screen with autoscaling selected. Only the first dataset is used to determine the scaling. Consequently, subsequent data points or even entire datasets may be out of range. The RESCALE macro, or the mouse menu option Rescale and Replot (R), may be used to automatically set new autoscaling limits so that all points will be in range. The datasets will be read again and replotted. DataPlot will attempt to rescale such that PLOTTEXT and LEGEND strings will also be in range. Values for Xminimum, Xmaximum, Yminimum, and Ymaximum may be entered on the line with RESCALE. These values will be used for rescaling, instead of the default range if desired. This is useful for zooming in on a section of data. A default value will be used where a new value is omitted. For instance, the macro command RESCALE ,,0,1 would use the default extreme values for Xminimum and Xmaximum, but would set Yminimum to 0 and Ymaximum to 1, and then replot the datasets. 16. SKETCH FREEHAND This mode permits the user to select a color and turn on pixels by moving the mouse over them while holding the left mouse button down. The results are only shown on the screen and can only be copied to a printer through the ScreenPrint commands. This makes an extremely crude painting program. 17. HPGL and PLT: The Hewlett-Packard Graphics Language is used to drive HP pen plotters. It can also be used to drive any preferences supported graphics printer through the use of the PLT: device, which was written by Rich Champeaux and Jim Miller. The PLT: device accepts HPGL commands and produces a raster image which can be displayed on the Amiga screen, or sent to the printer. The instructions for installing the PLT: device are included in the PLT.doc file. All of the PLT software is included at no extra cost. If PaperPlot HPGL is selected, then the output will be a file of HPGL commands. That file can be copied to PLT:S for a screen preview, or copied to PLT: for output to your printer. It is an ASCII file, and can be edited, if necessary. Pen 1 is used for the text, with pens 2 through 8 used for plotting the data. The pen number is incremented for each dataset. The CurveColor option will override the automatic increment. PLT: uses black as the default color for all pens. The CLI command copy hpglfile to plt:/000-1/f00-3/ will produce a plot with pen 1 set to black and a thickness of 1 pixel, and with pen 2 set to red and a thickness of 3 pixels. The three consecutive digits specify, in hex, the relative amounts of red, green, and blue. The dashed number specifies the pen width in pixels. If you have sufficient ram, then you can specify PLT: as the output device directly from DataPlot, with any color options you desire. If your printer is monochrome, then color options should not be specified. Specifying PLT:S for a screen preview directly from DataPlot2.1 has sometimes resulted in corrupted RAM. You are hereby warned! You need a lot of chip RAM in order to make a screen preview by copying the hpgl output file to PLT:s. If there is insufficient free RAM then you will get an error message stating unable to open PLT:. If you intend to install PLT:, then please read the instructions. Essentially, it consists of adding a MountList entry in DEVS:, copying the plt-handler to L:, and assigning PLTDATA: to a subdirectory containing the plot fonts. A batch file is included for automatically modifying your MountList, and copying the PLT-handler to L: for you. It also assigns PLTDATA: to the directory containing the fonts and a font list. This file should only be executed once! You may want to modify your Startup-Sequence to Mount PLT: and to Assign PLTDATA: to the appropriate directory. 18. DRAWFUNCTION DataPlot2.1 will also plot functions entered by the user, either in a macro or interactively from the mouse menu. The function must be a function of x only, unlike functions which can be applied to data points. If no data has yet been plotted, then the limits which are entered for plotting the function will also be used to auto-scale the plot. The same set of functions used for manipulating the data points is available for DrawFunction. A sample DrawFunction command is: DrawFunction function [, Xmin, Xmax, Speed] DrawFunction 2+x-3.5*x^2, 0, 1.4, 10 When this command is processed, all spaces will be removed from the line so that only commas may be used to separate the values. The values in brackets are optional. If the Xmin value or the Xmax value is omitted, then the scale maximum and maximum values will be used. The default value for the Speed is 10, meaning that the value of the function will be evaluated every 10 pixels from Xmin to Xmax and a straight line segment will be drawn from one point to the next. If the spatial frequency of the function is high, then the Speed may need to be set lower to increase the resolution of the plot. When used in a macro without specifying Xmin and Xmax, the function will be drawn all the way across the plot. 19. SCREENPRINT Under the ScreenPrint menu item, the user may select either portrait (vertical) or landscape (sideways) orientation for a pixel to pixel printer copy of the plot window. Any pixel that is other than the background color (color 0) will be printed as a dot on the printer. The size of the printout depends on the size and resolution of the plot window and the orientation. If the plot is too large to fit the page with the selected resolution, the resolution is automatically increased in order to shrink the size of the plot. The printer must be compatible with the Epson graphics commands for this to work properly. A full size plot on a 640x200 screen will give a nice, small plot on the printer in the portrait mode. In the landscape mode, it will be long in the x axis and short in the y axis. A full size plot on a 640x400 screen will give a nice large plot in the landscape mode. A ScreenPrint from a 640x200 screen will also give a nice plot if the width is reduced to 480 pixels, or slightly less, in the portrait mode. The print will then be about the width of the standard size 8.5 inch x 11 inch paper. 20. GRAPHICDUMP Selecting GraphicDump will result in a printer output using the Preferences selected options to the Preferences selected graphics printer. The appearance of the output can change greatly with size, color, and the graphics options. The best results will probably be obtained by using a black background (color 0 0,0,0) with white curves (color 1 15,15,15) using a screendepth of 1 for a plot with only 2 colors. The Preference option for "negative" should also be selected. Other combinations will also work. 21. SAMPLE FILES There are sample data files and macro files on the DataPlot2.1 disk. Please examine them to see examples of the proper format. 22. THE END Your suggestions for improving DataPlot are welcomed. The source code, in AmigaBASIC as extended by Absoft for their AC/BASIC compiler, is now over 8000 lines (200,000 bytes) and is available for $12, postage paid. Bytes and Bullets Route 3 Box 3532 Manchester TN 37355 (615)-596-2077