Tools for Quantitative Archaeology
             Kintigh email

TFQA Documentation
TFQA Orders
Kintigh's ASU Home

Running TFQA Graphics Programs


The TFQA graphics programs (KMPLT, DIVPLT, LDPLT, BAYES, SCAT, and FORD) do not run well under Windows XP (printscreen doesn't work) and do not run directly, under Windows 7 or more recent versions. They can be made to run well using DosBox a freeware emulator of 16 bit Windows. It is a bit of extra work to set up but does work fine. You only need to use this for the graphics programs--KMPLT, DIVPLT, LDPLT, BAYES, SCAT, and FORD not any of the others.

Setup to Run the Graphics Programs

Downloading DosBox (freeware)

Go to
Click on the number next to the "Latest Version" below the heading at the upper right
Click on the "Windows" line within the DosBox section of the Download page to download the DOSBOX setup file
Save the downloaded setup file, e.g., DosBox0.74-win32-installer.exe someplace handy like the desktop
Find the downloaded file wherever you saved it and double click on it to perform the installation, responding to the obvious prompts as it proceeds--this takes only a few seconds. (You will probably need administrator privileges to do this, as with other installations.
Close the Install window by clicking on the "Close" button.
You will now have a DosBox icon on your desktop and a DosBox folder on your Start menu.

Configuring DosBox

From the start menu, all programs, click on the DOSBOX folder, and you will see within it a Optiions (Configuration in earlier DosBox versions) folder. Click on that, and within that you will see "DosBox 0.74 Options" ("Edit Configuration" in earlier DosBox versions. That will open a window with the configuration file.
Scroll to the very bottom of the file and paste in the following text exactly as shown

rem Set up to run TFQA
mount t c:\progra~1\tfqa
mount u yourdatafolder
path t:\

In the 3rd line, for yourdatafolder substitute the path--using SHORT FILE NAMES--to the folder on your hard drive containing the data you want to analyze. (You don't need to know this but if you want to understand more see the Wikpedia article about short file names). Now, this gets a little geeky but is not really hard. The short file name can have no spaces or special characters and each part of the path can have no more than 8 characters followed by an optional period and 3 character extension. The longer files names that are used in all the more recent versions of windows all have short file name equivalents. What you need to do is figure out the short file name associated with the folder that has your data files.

In Windows 7 and up, the easiest way to do this is use Windows Explorer (Start>All Programs>Accessories)to navigate to the folder that has your files. Then hold down the shift key and right click on the folder name in the folder tree on the left of the window. That will bring up a context menu from which you should choose "Open Command Window Here". This will open up a black command window with a prompt showing you the current folder's path followed by a >, e.g., in Windows 7 something like C:\Users\Your Name\Documents\Your Folder.


In XP, if you didn't install CmdHere as a part of the TFQA installation, you will want to do it now (1 time only). The free Microsoft CmdHere utility can be installed (run) or downloaded (save) from the Microsoft Powertoys web site. Once it is installed (double click on CmdHere.exe if you downloaded it), it is available on your computer all the time. Use Windows explorer to navigate to the folder with your data files, and then, with the folder (not a data file) highlighted, you right click and select "Open Command Window Here". This will open up a black command window with a prompt showing you the current folder's path followed by a >, e.g., in XP it might be something like C:\Documents and Settings\your user name\My Documents\your folder

Now here is the trick. In the command widow at the prompt type command (not cmd) and press Enter. The prompt in the command window changes to the short file name version, in my case, I see in XP a change from

c:\My Documents\Course\Intrasite>command




At this point you need to go back to the editor window for dosbox.conf and type exactly what you see for the command prompt (omitting the > and ignoring case; cut and patste won't work) where yourdatafolder appears. In my case

mount u c:\mydocu~1\course\intras~1

If you were able to get the short file name prompt then File>Save the dosbox.conf file with the changes and and close the editor. Go to the black command window and type Exit followed by Enter to close it (or just click on the X in the upper right and press the "End Now" button in the warning box).

If you weren't able to get the short file name then read the Wikipedia article cited above about converting long to short file names and see if you can get it.

Running TFQA Graphics Programs

Now that you have done the setup, it is easy. To run one of the graphics programs double click on the DOSBOX icon on your desktop (or from the DosBox Folder on your start menu). That will open a new black command window in which the graphics programs can run.

Just type the name of the program, e.g., scat and then press Enter and it will run and will find the files in that directory. You can run any number of analyses this way. To finish just type Exit and press Enter.


However, before you get going, you will need to do one additional thing. The graphics programs do not deal with ordinary Windows file names. File names used by these DOS programs are restricted, at most, 8 character file names (with no embedded spaces or special characters allowed except "_") followed, optionally, by a period and a 3 character extension (e.g. if you have a file called my site data.plt change it to mysite.plt or something else without spaces or special characters and with no more than 8 characters plus a period and a 3 character extension.


If you have files you want these graphics programs to read that don't meet these DOS conventions, you must rename them (e.g. using Windows Explorer) so that they do. Because the program interface always prompts for file names that you have to type (rather than selecting them from a menu) and because several key programs (divers, kmeans, and lden) interact with plotting program counterparts (notably DIVPLT, KMPLT, and LDPLT), you will want to stick with relatively short file names with 3 character extensions. Better yet, just use the DOS conventions of up 8 character file names(with no embedded blanks or special characters except underscore), followed by a 3 character extension.

Remember that if you change analysis folders you will need to reedit the DOSBOX configuration file to change to another folder.

If this is working, you can delete the DosBox setup file.

Printing Graphics from TFQA

In most cases you won't be able to directly print the graphics you see on the screen directly from the TFQA graphics programs (KMPLT, DIVPLT, LDPLT, BAYES, SCAT, and FORD). There are several solutions, however.


The PrintScreen Approach


If you use DOSBOX you can use PrintScreen with the graphics programs very nicely from Windows XP, Vista, and Windows 7. PrintScreen will produce lower quality graphics than printing the HPGL files from another application but will be handier most of the time.


While a plot is displayed, you can press <Shift><PrintScreen> or better <alt><PrintScreen> for only the active window in Windows 7. This sends the screen image (which is at a much lower resolution that the HPGL generated plot discussed below) to the clipboard (see You can then Paste the clipboard into a graphics application or a graphics box of a word processing program. You may have to Invert the image to make it Black-on-White rather than White-on-Black. You can then save it in another form and bring it into other applications or print it from the one you are using.

A better, genral purpose, solution that allows you to draw a window around the portion of the whole desktop that you want to copy is provided by Gadwin PrintScreen (free).


Saving Graphical Output and Printing from Another Program


Generally you will either want to use Print Screen (as above) or will want to run the plotting programs and view the output on the screen to decide which ones you want to print and then rerun those particular plots saving output to a file (one graphic per file). You can then import these files and then print them from another application. That is, you want to say yes,you want to plot the results to a plotter or printer and that the output should go to a [F]ile. When prompted, supply a file name with an .HPG extension. This file can then be imported into word processing or graphics programs. The graphic output of the programs is an ASCII file in HPGL (Hewlett Packard Graphics Language). That language is turned into graphics by a plotter or an HP PCL printer.


Word Perfect, Corel Presentations, Corel Draw and many other graphics programs will import HPGL files very nicely. (If Word Perfect does not give the option of importing HPGL files you need to rerun the install program and install the HPG conversion filters; you should not need to reinstall the whole program). Microsoft does not supply an HPGL graphics filter with Word 2003 but makes one available through their web site that works with Word 2003 and all 32 bit versions earlier versions of Word--see However, this filter does not work with Word 2007 and Microsoft has offered no replacement. Neither the Corel nor the Word conversions are perfect but they produce quite acceptable plots. To be safe you should check the printed results against what appears on the screen.


ViewCompanion Standard (; free trial; education users may wish to inquire about educational pricing) will allow you to view the HGPGL files, to convert them to a great variety of other formats including JPG, and to print them directly. When you open the file, the default line style may be very thin, but you can modify these settings. If you want to print it with thicker lines:


Start ViewCompanion

Click on Tools>Pen Table

Click on pen 1 in the small window that opens, making sure that it is highlighted (if it isn't highlighted nothing happens)

Change the width below the box, e.g., to .02

Click the Apply button

Make sure the box that says "Use Pen Table" is checked (it should be checked automatically)

Click the OK button


Printing Directly to a HP Laserjet Printer or Plotter (Generally you can't)


Graphics can only be directly printed from TFQA programs that produce full screen graphics (KMPLT, DIVPLT, LDPLT, BAYES, SCAT, and FORD) if all three of the following conditions are met: (1) programs are running under Windows 95, 98, or 2000; (2) the printer is connected directly to the computer on which the programs are run; and (3) the printer implements HPGL (most HP Laserjet printers do). Usually, you must save each graphical output you want printed to a file (use a .hpg extension) and print the files from another program (more on printing from these files below).


If all of the above conditions apply, you may be able to print graphics directly on a printer from the toolkit to a HP Laserjet. Many newer Laserjet models can work both in PCL and Postscript mode and you can have the same printer set up both ways on your computer simultaneously. You want to print to the PCL printer. To print the graphics directly, you will need to send the output directly to the printer. However, under Windows 95 or Windows 98, you will need to tell the printer to capture the DOS printer port output. This has to be done only once, do Start>Settings>Printers. Then right click on the (networked or otherwise) HP PCL (not Postscript) printer. Click on the Details Tab, then click on Capture Printer Port. Make sure the scroll bar is at the top. If LPT1 is associated with this printer, it is already set up. Otherwise type in, below LPT1, the printer address shown on the previous screen, e.g., \\networknode\HPPrinterName\. Check the box that says "Reconnect at Logon". Then click OK until you get back to the desktop. With some networked printers, this approach may not be possible. If not, you will need to print the output from a Windows application.


If the printers are set up properly, all you have to do is run the program from a Command Prompt window as described above. Tell the program, Yes you want to Plot the results to a plotter or Laserjet printer, that the HPGL output should go to PRN, and that the HP Laserjet or Plotter Paper Size is L for Laserjet. Then, just before it produces the plot, it asks you if you want to Plot the output, reply Yes. This sends the output to the printer.


Creating Graphics from the Data


It is a lot more trouble, but you can extract the data necessary to create the plot from the PLT file. For example, if you look at the .PLT file produced by Divers (not the .HPG file produced by DivPlt that actually contains the plot) you will see that it contains all the data needed to create the plots. You can read that data into a statistics or graphing program and use it to create plots. For Divers, the composition of the .plt file is as follows. (You won't need all of this information):

title date no of elements, min ss, max ss, increment, no of intervals, no of points, conf.level, iproginc, ipointtrial, iinctrial, disteven,hmax,avlevpct (you don't need these)

for each element, the element proportion

for each sample size interval: ss, mean richness, std of richness, richness conf. interval low, richness conf. interval high, minimum richness, maximum richness, mean evenness, std of evenness, evenness conf. interval low, evenness conf. interval high, minimum evenness, maximum evenness.


for each data point: symbol, label sample size, number of trials, richness evenness, (and depending on the computations, richness lower percentile, richness percentile, richness upper percentile, evenness lower percentile, evenness percentile, evenness upper percentile


Home Top Overview Ordering Documentation

Page Last Updated - 29-Oct-2012