TFQA: Tools for Quantitative Archaeology - Statistical Analysis Software for Archaeology TFQA
TFQA Logo

TFQA: Tools for Quantitative Archaeology
     kintigh@tfqa.com   +1 (505) 395-7979

TFQA Home
TFQA Documentation
TFQA Orders
Kintigh (ASU Directory)


Running TFQA Graphics Programs

The TFQA graphics programs (KMPLT, DIVPLT, LDPLT, BAYES, SCAT, FORD, STPdos, and SAMPMEANdos ) do not run well under Windows XP (printscreen doesn't work) and do not run directly, under Windows 7, 8, 10 or 11. They can be made to run well using DOSBox a freeware emulator of 16 bit Windows or a newer spinoff of DOSBox, DOSBox-X It is a bit of extra work to set up but does work fine. You must use one of these only for the graphics programs--KMPLT, DIVPLT, LDPLT, BAYES, SCAT, and FORD, not any of the others (which are true Windows programs).

Setup to Run the Graphics Programs (See Below for DOSBox-X)

Downloading DosBox (freeware)
Go to http://www.dosbox.com
Click on the "Downloads" menu item under teh DOSBOX banner
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-3-win-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 Options folder. Click on that, and within that you will see "DosBox 0.74 Options" entry. Click on that to 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 TFQAprogramfolder
mount u yourdatafolder
path t:\
u:


In the second line, for TFQAprogramfolder substitute the path--using SHORT FILE NAMES--for the folder in which the TFQA programs were saved e.g., c:\progra~1\tfqa might be used for c:\program files.  In the 3rd line, for yourdatafolder substitute the path--again 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) or search Google for something like "find short path for Windows folder". Now, this gets a little geeky. 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 no more than 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 path associated with the folder that has your data files.

In Windows 10, open the Run app and enter "cmd' in the Open: box and click OK.  In the Command window type "dir/x" and press Enter.  That will give you the short file name for each folder and file in the current directory.  You can change directories by using the "cd" command with the regular long paths, e.g. "cd c:\users\kintigh\dropbox (personal)". You need to construct a path by assembling all the short file name pieces.  Remember that the pieces that are so-called 8.3 filenames with no spaces and special characters are OK as both long and short file names.  Thus for c:\users\kintigh\dropbox (personal)\pascal\project folder the short file name path might be c:\users\kintigh\dropbo~1\pascal\projec~2 .  Sorry, they keep making it harder.

You can search In Windows 7, 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.

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

to

C:\MYDOCU~1\COURSE\INTRAS~1>

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.

Using DOSBox-X instead of DOSBox

I have not experimented too much with DOSBox X, but it gets around most of the hassle with the short file names.  In installing DOSBox-X, when it asks, tell it to configure it for DOS 7.1.  When running DOSBox-X, instead of typing the painful MOUNT commands for the program and data directories using short file names that you have to do in DOSBox you can use the Drive menu option (top bar) to easily execute the MOUNT commands within a window the shows you the actual file names and in which you can navigate.  Or, you can type them in to the DOSBox-X prompt every time you run DOSBox-X if you are a glutton for punishment, or you can put them in the DOSBox-X configuration folder so you don't have to do anything at all next time. As with DOSBox, you use the PATH command at the Z:> prompt (e.g., PATH T:\), as described above, so it finds the programs (i=and put that in the DOSBox-X configuration file to make it easier next time.  As in DOSBox, change the active drive to the drive with you data at the Z:\ prompt (e.g., U:), also as described above).  The DIR command shows you the files in the U: directory and you can just type the program name to begin, e.g. U:> FORD.

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 DOXBox 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, or use its short file name, which you can probably see if you type the directory command, DIR at the prompt.

If you have files you want these graphics programs to read that don't meet these DOS conventions, you must either use their short files names or 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 with your data files 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 a PrintScreen utility for your version of Windows with the graphics programs . PrintScreen will produce lower quality graphics than printing the HPGL files from another application but will be handier most of the time.  In Wndows 10 an excellent PrintScreen 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). With it, you can send the image (which is at a much lower resolution that the HPGL generated plot discussed below) to a file or the clipboard. 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.

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.

Some versions of WordPerfect, Corel Presentations, Corel Draw and many other graphics programs will import and then print high resolution 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 last I looked.  You might check the Microsoft to see if one has become available.  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 (http://www.softwarecompanions.com/viewcomp.html; free trial; education users may wish to inquire about educational pricing) will allow you to view the HPGL 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 (Note: 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. The R statsitics platform works well for this.  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

Page Last Updated: 3 December 2020

Home Top Overview Ordering Documentation