SHORT NOTE

TERNPLOT: AN EXCEL SPREADSHEET FOR TERNARY DIAGRAMS
Daniel Marshall Department of Earth Sciences, Carleton University, Ottawa Canada, K1S 5B6 (email: marshall@ccs.carleton.ca)
Download Spreadsheet

Introduction
Ternary diagrams are used almost exclusively by earth scientists and unfortunately have not been incorporated into most of the commercially available graphing software packages for IBM PCs and compatibles. Some packages are available such as Igpet ( Carr, 1995), Petro-calc plot (Sidder, 1994), Newpet (Clarke et al., 1994), Minpet (Richard, 1992) and Triplot (Baedke and Thompson, 1993), but these programs have limitations in that they require the user to learn yet another computer program, or have lim ited scaling capabilities for the length of the axes and placement of tickmarks. As most earth scientists are familiar with one of the commercially available spreadsheet programs, TernPlot was created in Excel 4.0 as data can be easily transferred from a variety of spreadsheets into Excel. TernPlot offers the user scaleable axes, tick mark increment and length selection, and the diagrams can be output directly to a printer or transferred to commercially available drawing programs via the Windows Clipboa rd. With the aid of the help facility within Excel a new user can quickly become familiar with the rudimentary commands necessary for moving data, copying cells and selecting symbol types.
The minimum hardware and software requirements are an IBM PC or compatible with Windows and Excel 4.0 (or 5.0), and a Windows 3.1 compatible printer. The program is available from the anonymous ftp site iamg.org.

Setup
Individual printers, Windows installations and Excel versions occasionally result in a slight variation of the length of the ternary axes. To ensure that the default settings are consistent with your hardware, it is best to copy the ternplot.xls file to your hard disk and print out a ternary diagram on your printer. If the axes on the printout have different lengths, change the B-C axis length adjustment in cell F341 (Fig. 1). Increasing or decreasing the B-C axis length adjustment value in cell 34 1 results in a respective increase or decrease in the length of the B-C axis relative to lengths of the A-B and A-C axes. A value of 75.00 produces axes of equal length with a wide variety of printers and Excel version 4.0. A value of 81 produces axes o f similar lengths in Excel version 5. It is not necessary to change any of the other values shown in figure 1.

Data
Raw data can be entered into columns B, C and D starting at row 17 (Fig 2.). These three rows correspond to the A, B and C apices shown in figure 3. Data can be imported from the clipboard, imported from an ASCII file or entered from the keyboard up to a maximum of 300 points. Sample numbers can be entered in column A (Fig.2). The normalized data are calculated from the unnormalized values (columns B,C and D) and stored in columns H, I and J (Fig. 2). The x and y coordinate values used for plotting are calculated in columns F and G. To reduce the initial size of the spreadsheet only the first three rows (17 to 19) have the necessary formulas for the normalization and x,y coordinate calculations. As the user adds more points to the spreadsheet, the y should also copy the formulas in cells F19 through J19 to cells Fxx through Jxx, where xx corresponds to the row number of any row containing unnormalized data. The user should not delete any columns or rows of data as the calculations for the axes (Fi gs. 1 & 2) and tick marks (columns AN through AR) are performed in other areas of the spreadsheet and some cells crucial to the construction of the ternary diagram may be inadvertently deleted.
Symbol shapes are limited to those available in Excel. Individual symbols are assigned to each data series as defined in the Excel chart menu. In order to have different symbols the user must define different series using the Chart, Edit series men us in Excel. The user is referred to the Excel Help menu or Excel documentation for further information on editing series and selecting symbol types.

FIGS 1&2

Axes Scaling and Tick Marks
Axes can be scaled by changing the modifiable plotting parameters for the A and B scales (Fig. 2). The minimum and maximum scale for A (cells C9 and D9 respectively) and the minimum value for the B scale (cell C10) may be changed. The other three p arameters, the B maximum, C minimum and C maximum are fixed by the choice of the modifiable plotting parameters (Fig. 2).

You can specify up to a maximum of 25 tick marks per axis. The increment for the tick axis selection can be found in cell E9 (Fig. 2). Tick mark length is determined by the value in cell F9 (Fig. 2). This value can be any value greater than 0, with a value in excess of 5 resulting in a grid across the entire diagram as in figure 1. Tick marks are always on the inside of the ternary plot. This spreadsheet will not draw the tick marks outside of the triangle.

Axes Labels
The labels of the apices of the ternary diagram can be changed within Excel Chart, by clicking the mouse button on the label, and then editing the text as it is displayed at the top of the Excel Chart window. See your Excel help file or documentatio n for further information.

Importing to Other Graphics Programs via the Clipboard
The graphics capabilities of Excel are limited relative to other drawing programs such as Corel Draw. For the production of publication quality figures it is advantageous to be able to import the ternary diagrams to another drawing program to add fi eld boundaries, tie lines and labels. To copy the ternary diagram to the clipboard, explode the ternary diagram to full screen by double clicking on the ternary diagram. Go to the "Chart" menu and chose "Select Chart". Go to the "Edit" menu chose "Copy ". Minimize the excel program and open your drawing program. Corel Draw version 4 is used here as an example: Go to the "Edit" menu and chose "Paste Special", then "Picture". This imports the ternary diagram as an object and the user can enlarge or r educe the diagram to their desired size. However, the user should maintain the x-y aspect ratio during enlargement or reduction. Should the user wish to modify individual parts of the diagram. Select the entire object (ternary diagram), go to the "Arra nge" menu and select "Ungroup". Click the mouse outside of the selected objects. The user will now be able to select any portion of the ternary diagram for editing by clicking the mouse on the desired portion of the diagram.

Acknowledgments
This article benefitted from reviews by two Computers and Geosciences reviewers. Research funds from the Swiss National Science Foundantion grants 21-30153.90 and 20-36425.92 are gratefully acknowledged.

References

Baedke, S.J., and Thompson, T.A., 1993, Program Triplot v. 2.0, anonymous ftp site: ftp.cica.indiana.edu, File: /pub/pc/win3/desktop/triplt21.zip.

Carr, M., 1995, Program Igpet, Terra Softa Inc. Somerset, New Jersey, U.S.A.

Clarke, D., Mengel, F., Coish, R.A., and Kosinowski, M.H.F. 1994, Program Newpet v. 94.01.07, anonymous ftp site: sparky2.esd.mun.ca, email: daryl@esd.mun.ca or daryl@ garfield.cs.mun.ca

Richard, L., 1992, Program MinPet v. 1.2. MinPet Geological Software, 146 du Chateau, Masson-Angers, PQ, Canada, J8M 1J3..

Mustard, P.S. and Richardson, J.M. 1990, A lotus 1-2-3 template for triangular plots, Geobyte, vol 5, no. 2 p. 47-53

Sidder, G.B., 1994, Petro-Calc plot, Microsoft Excel macros to aid petrologic interpretation: Computers and Geosciences, v. 20, p. 1041-1061.

Marshall Home Page