GFX(1) UNIX System V (22 April 1994) GFX(1) NAME gfx - GF for X a plotting program by T. Shield SYNOPSIS gfx [-g geometry] [-d display] [filename] DESCRIPTION gfx is a quick plotting program that also produces PostScript output. OPTIONS -g Specifies the inital window geometry. -d Specifies the X display server to use. filename specifies the filename of the data file, if no extension is given .gf is assumed. If a filename is not specified, you are prompted for one. COMMANDS Gfx is a hybrid text/graphics program. It uses an X-window to display the graph and this window may be resized etc as usual for x-windows. However all user commands are text based, thru a menu of commands. This menu is printed in the terminal window from which gfx was run by pressing 'm' in the graphics window. There are 10 menu items: 0 exits the menu and returns to active update of the graphics window (for resizes and exposure events etc). 1 input new file, you are prompted for a new filename, the existing graph is discarded. 2 save the current graph to a file. 4 quit gf. You are not prompted to save your current graph before exiting. Note that the 'q' key typed in the graphics window quits Gfx. 5 rescale the graph. You are prompted for the scaling information. 6 quick rescale. Rescales the graph using the max/min in the current data. 7 Add comments. This allows text to be added to the graph at a location chosen with a mouse click. This information is save in a file using 2. 8 append another file into the current graph, allows multiple curves on one plot. Page 1 (printed 10/1/95) GFX(1) UNIX System V (22 April 1994) GFX(1) 9 produce PostScript or HPGL output file from the current graph for hard copy out put. Details are given below, see the PROFILE section. 10 profile, this function allows various settings to be changed that affect the data file format and output plot format. 11 linear curve fit, does a linear curve fit on the data between two points selected by mouse clicks. 12 data transfomations, provides a means to apply a linear transformation to the data, remove data sections, reduce the number of data points or smooth the data. 13 re-read the current data file. This provides a quick way to update the display of a file if it has changed. This command has no effect if mulitple files have been appened together. Typing a 'r' key in the display window is a shortcut for this menu command. The commands with single digit numbers may also be used by typing the menu number in the graphics window. This is a short cut instead of using the "m" key. The two digit menu choices have single letter short cuts. PROFILE This selction lets you select and modify many of the advanced features of GF that have to do with non-standard data file formats and plotting options. This key has exactly the same effect as entering "p" at the filename prompt either when GF is first loaded or when key 8 is pressed. The options that are user selectable here are the following: Variable plot lettering size: obvious, is independent of plot size. Pen speed: This only applies to an HP plotter, and can be reduced to give higher quality plots. Draw X=0 line: if set to Y (default) the line for the Y axis is drawn on both the screen and a hard copy, N turns it off. Draw Y=0 line: if set to Y (default) the line for the X axis is drawn on both the screen and a hard copy, N turns it off. Rotate plot 90 degrees: is self explanitory. Data Format: The data format consists of two numbers: the Page 2 (printed 10/1/95) GFX(1) UNIX System V (22 April 1994) GFX(1) length of the invec field (VL) and the length of the data field (DL). Each plot file line consists of an invec field followed by at least 2 data fields, thus the minimum line length is VL+2*DL. It is possible to set VL=0 to have no invec field. However, DL must be at least 8 since the data is always written to the file in FORTRAN style exponential format. The standard values are VL=3 and DL=10, and they apply when both reading and writing files. For more details see the data format section below. Use EOF instead of NP: this means use the physical end of the data file to detect the end of the data instead of the number of points, which, for the standard plot file format, is given in the first line of the plot file. This is automatically determined by the length of the first line of data. If the EOF method is used there can be no scaling information stored at the end of the file and the number of data points in the file need not be stored in the first line of the file. Note that this only applies to reading files, all files are written by GF with the number of points in the first line of the file so that scaling information may be included at the end of the file. Note: When the data format switches do not match the data format of the data file being read, unpredictable errors and/or plots may result. When in doubt check the data file for errors and agreement to the data format used. If more than two data columns are present in the data file, then Gfx will prompt you for which columns to use as x and y data for the plot. NOTE: Gfx only reads the columns you specify and only writes 2 column data files, thus reading in two columns of a data file and the saving the data back to that file results in the loss of the data in the other columns. HARD COPY OUTPUT The plots produced by GF on a plotter/LaserWriter are essentially identical to what is shown on the screen. The extra options available for hardcopy plots include variable plot lettering size, control of the overall plot size and use of various line types. The line types are denoted by their numbers as given in the plotter manual, as is the pattern length denoted PPL. The plot is divided up into three parts, which may be drawn separately or all together. They are: The Axes: They include the plot border, the scaling numbers, the axes labels and any tick/grids, as well as the x=0 or y=0, lines if selected. The Curve(s): This is the actual data. This option lets Page 3 (printed 10/1/95) GFX(1) UNIX System V (22 April 1994) GFX(1) you add a curve to an existing plot or use preprepared graph paper etc. The Text: These are the on-plot comments and this option allows you to add comments to an existing plot at a later time or to simply draw titles on a paper. See the section on TEXT FORMATTING below for information on text input. Multi-colors: this option causes the program to produce a complete plot and to prompt you for the pen/line type to use. The prompts for pen/line type during the curve drawing occur every time an invec value of zero is detected. Thus each separate curve on the plot can be given a different line type, etc. For the LaserWriter the pen number refers to the line thickness for line drawing and to the Font for lettering. The line types for the LaserWriter match those produced by HP plotters. This option also allows the color of the data segment to be selected by using negative numbers for the pen number. For a complete list of colors and line types enter '?' to the prompt. At a font prompt enter 0 to get a list of available fonts. User-position: This option allows the plot to be placed at a user input postion on the paper. The program will ask for the horizontal and vertical offsets in inches to be applied to the lower lefthand corner of the plot border from the corresponding corner of the paper (depending on whether the plot is rotated or not). This option can be used to place 2 plots on the same sheet of paper. To do this with the LaserWriter it is necessary to not eject the first plot from the LaserWriter by answering no (N) to the eject page question and the doing another plot with different offsets and then answering yes (Y) to the eject prompt this time. There is no limit to the number of plots on a page, however, there is a time limit of 5 minutes between sending the plots to the LaserWriter or the previous plots will be discarded. The default combination of the above is ACT, that is, draw numbers 1-3 above. To get the multi-colors option, entering M is the same as MACT. Similarly a U is equivalent to UACT. To draw the axes and curve with no titles use AC, etc. GF assumes that the HP plotter has a .7mm black pen in position number one, which GF uses for the plot border (by default), and a .3mm black pen in position number 2 (the default for the rest of the plot) of a multipen HP plotter. The LaserWriter uses approximately the same line thicknesses as its defaults as well. When the multicolors options has been choosen, these are user selectable. Page 4 (printed 10/1/95) GFX(1) UNIX System V (22 April 1994) GFX(1) TEXT FORMATTING Gfx supports a limited TeX like formatting to allow superscripts, subsripts and symbol font to be used in axis labels and comments. A superscript is started with the '^' character. The following single character is then used for a superscript. If multiple character superscripts are required enclose the characters between '{' and '}'. The '_' character produces subscripts in the same manner. To display a group of characters in symbol font (greek) enclose these characters between '$' characters. Note that a superscript (or subscript) greek character counts as multiple characters. For example x^{$a$} produces x raised to the alpha. Note that currently this formatting only applies to postscript output. The text displayed on the screen is not formatted. To display data symbols in comments, use the '@' character followed by the number of the symbol (2-10) you wish to display. DATA FILE FORMAT The following is the file EXAMPLE.GF, which contains comments at the beginning that will explain the data format used in GF readable files. The file is in plain ASCII that can be edited with any suitable editor such as xedit. FILE = EXAMPLE.GF C This is a standard format GF readable data file. The C first line of the file contains the number of data points in C the file. The format of the data is I3,2E10.4 the I3 field C is the control or INVEC field, it tells GF what to do with C that data line as follows: C C C -16 to -1 Works as 0 below an specifies color number C of the absolute value of this invec, C for screen display only with an EGA C 0 Move to this x,y without drawing a line. C This separates data segments for multiple C curves on one graph. this also causes the C next curve to be drawn in a different color C on the screen when an EGA is used. C 1 Draw a line from the previous pt to x,y. C 2-10 Move to x,y as in 0 and put a symbol at x,y C 2 open square C 3 open circle C 4 open triangle C 5 open inverted triangle C 6 solid square C 7 solid circle Page 5 (printed 10/1/95) GFX(1) UNIX System V (22 April 1994) GFX(1) C 8 solid triangle C 9 solid inverted triangle C 10 cross C 11 same as 1 only add an open arrow head C 12 11 with a filled arrow head. C C 33-127 puts the ASCII character of the invec value C at the data point. C C GF will ignore any lines with a C or c in the first C column that preceed the first numeric line of the file. GF C will also ignore comments at the right of the data, however if C they appear on the first line after the number of points GF C will interpret it as MULTICOLUMN data. C C The scaling information is stored in the file after the C data as shown below. If this information is not found after C the data, the program will prompt for it after the file is C loaded and before a plot can be drawn. C The profile menu choice or "p" in the file prompt C allows the file format to be modified to use C nonstandard data formats. The following may be changed: C C 1. The length of the INVEC and data Fields, an C INVEC length of 0 assumes INVEC=1 for all pts. C This works on read and write from GF. C C 2. The end-of-file (EOF) may be used instead of the C number of points on the first line of the file, C this precludes the inclusion of scaling info at the C end of the file. This only applies to reading a file. C (note: this is automatically determined in Gfx) C C GF will also allow multi-column data files to be read, C that is the number of data fields can be more than 2. If C such is the case GF will prompt for the data field column C number to use as the X values and for the column number to C use as the Y values. This will work with options 1 and 2 C directly above as well. Multicolumns are automatically C detected without user intervention. Note that GF will ignore C the other columns not selected for use and hence if the file C is rewritten it will only contain 2 data columns. C 106 number of data points in this file 0+.0000E+00+.0000E+00 1+.2000E+00+.1987E+00 invec=0 start of data segment (line above) 1+.4000E+00+.3894E+00 1+.6000E+00+.5646E+00 1+.8000E+00+.7174E+00 1+.1000E+01+.8415E+00 1+.1200E+01+.9320E+00 1+.1400E+01+.9854E+00 Page 6 (printed 10/1/95) GFX(1) UNIX System V (22 April 1994) GFX(1) 1+.1600E+01+.9996E+00 1+.1800E+01+.9738E+00 2+.1800E+01+.9738E+00 put a square at this point 1+.2000E+01+.9093E+00 1+.2200E+01+.8085E+00 1+.2400E+01+.6755E+00 1+.2600E+01+.5155E+00 1+.2800E+01+.3350E+00 1+.3000E+01+.1411E+00 1+.3200E+01-.5837E-01 3+.3200E+01-.5837E-01 another symbol here 1+.3400E+01-.2555E+00 1+.3600E+01-.4425E+00 1+.3800E+01-.6119E+00 1+.4000E+01-.7568E+00 1+.4200E+01-.8716E+00 1+.4400E+01-.9516E+00 1+.4600E+01-.9937E+00 1+.4800E+01-.9962E+00 1+.5000E+01-.9589E+00 1+.5200E+01-.8835E+00 1+.5400E+01-.7728E+00 1+.5600E+01-.6313E+00 1+.5800E+01-.4646E+00 1+.6000E+01-.2794E+00 1+.6200E+01-.8309E-01 1+.6400E+01+.1165E+00 1+.6600E+01+.3115E+00 1+.6800E+01+.4941E+00 1+.7000E+01+.6570E+00 1+.7200E+01+.7937E+00 1+.7400E+01+.8987E+00 1+.7600E+01+.9679E+00 1+.7800E+01+.9985E+00 1+.8000E+01+.9894E+00 1+.8200E+01+.9407E+00 1+.8400E+01+.8546E+00 1+.8600E+01+.7344E+00 1+.8800E+01+.5849E+00 1+.9000E+01+.4121E+00 1+.9200E+01+.2229E+00 1+.9400E+01+.2478E-01 1+.9600E+01-.1743E+00 1+.9800E+01-.3665E+00 1+.1000E+02-.5440E+00 1+.1020E+02-.6999E+00 1+.1040E+02-.8278E+00 1+.1060E+02-.9228E+00 1+.1080E+02-.9809E+00 1+.1100E+02-.1000E+01 1+.1120E+02-.9792E+00 4+.1120E+02-.9792E+00 Page 7 (printed 10/1/95) GFX(1) UNIX System V (22 April 1994) GFX(1) 1+.1140E+02-.9193E+00 1+.1160E+02-.8228E+00 1+.1180E+02-.6935E+00 1+.1200E+02-.5366E+00 1+.1220E+02-.3582E+00 1+.1240E+02-.1656E+00 1+.1260E+02+.3362E-01 1+.1280E+02+.2315E+00 1+.1300E+02+.4202E+00 1+.1320E+02+.5921E+00 1+.1340E+02+.7404E+00 1+.1360E+02+.8592E+00 1+.1380E+02+.9437E+00 1+.1400E+02+.9906E+00 1+.1420E+02+.9980E+00 1+.1440E+02+.9657E+00 1+.1460E+02+.8948E+00 1+.1480E+02+.7883E+00 1+.1500E+02+.6503E+00 1+.1520E+02+.4864E+00 1+.1540E+02+.3031E+00 1+.1560E+02+.1078E+00 1+.1580E+02-.9191E-01 1+.1600E+02-.2879E+00 1+.1620E+02-.4724E+00 1+.1640E+02-.6381E+00 1+.1660E+02-.7784E+00 1+.1680E+02-.8876E+00 1+.1700E+02-.9614E+00 1+.1720E+02-.9969E+00 1+.1740E+02-.9927E+00 1+.1760E+02-.9488E+00 5+.1760E+02-.9488E+00 1+.1780E+02-.8672E+00 1+.1800E+02-.7510E+00 1+.1820E+02-.6048E+00 1+.1840E+02-.4346E+00 1+.1860E+02-.2470E+00 1+.1880E+02-.4954E-01 1+.1900E+02+.1499E+00 1+.1920E+02+.3433E+00 6+.1920E+02+.3433E+00 1+.1940E+02+.5231E+00 1+.1960E+02+.6820E+00 1+.1980E+02+.8137E+00 1+.2000E+02+.9129E+00 end of 106 data points +.0000E+00+.2000E+02 xmin, xmax trailing L indicates log scale -.1000E+01+.1000E+01 ymin, ymax trailing L indicates log scale X AXIS LABEL Y AXIS LABEL T+.5000E+01+.2500E+00 ticks with xstep, ystep, comments on screen follow ISN'T THIS A FABULOUS PROGRAM? Page 8 (printed 10/1/95) GFX(1) UNIX System V (22 April 1994) GFX(1) 5 25 row, column at which to put above comment end of EXAMPLE.GF data file. BUGS Some bugs are probably lurking around. Please inform the author at shield@aem.umn.edu if any bugs are found. AUTHOR Tom Shield Page 9 (printed 10/1/95)