Ternplot: An excel spreadsheet for ternary diagrams

3
Compufers & Geosciences Vol. 22, No. 6, pp. 697699, 1996 Cmvrieht (%1 1996 Elsevier Science Ltd Pergamon PII: SOO98-3004(96)00012-X Printed’& drea;Britain. All rights reserved 0098-3004/96 $15.00 + 0.00 SHORT NOTE TERNPLOT: AN EXCEL SPREADSHEET FOR TERNARY DIAGRAMS DANIEL MARSHALL Department of Earth Sciences, Carleton University, Ottawa, KlS 5B6 Canada (email: [email protected]) (Received 9 September 1995; revised 16 November 1993 INTRODUCTION Ternary diagramsare used almost exclusively by earth scientists and unfortunately have not been incorporated into mostof the commercially available graphing softwarepackages for IBM PCsand com- patibles.Some packages are available,suchas Igpet (Carr, 1995) Petro-talc plot (Sidder, 1994) Newpet (Clarke and others, 1994),Minpet (Richard, 1992), and Triplot (Baedke and Thompson, 1993), but these programs have limited scaling capabilities for the lengths of the axes and placement of tick marks.As most earth scientists are familiar with one of the commercially available spreadsheet programs, Tern- Plot was created in Excel4.0. TernPlot offersthe user scaleable axes, tick-mark increment, and length selec- tion, anddiagrams can be output directly to a printer or transferred to drawing programs via the Windows Clipboard. 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 require- ments are an IBM PC compatible with Windowsand Excel 4.0 (or 5.0), and a Windows 3.1 compatible printer. The program is available from the anony- mousFTP site IAMG.ORG. SETUP The use of particular printers, Windows installa- tions, and Excel versions occasionally result in small differences in the lengthof the ternary axes. To ensure that the default settingsare consistentwith your hardware,it is advisable to copy the file ternplotxls 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 adjustmentin cell F341 (Fig. l), which resultsin an increase or decrease in the length of th . B-C axis relative to the lengthsof the A-B and A- (2 axes.A value of 75.00 produces axesof equal length for a wide variety of printers with Excel version 4.0. A value of 81 pro- duces axes of similarlengths in Excel version5. It is not necessary to change any of the other values shown in Figure 1. DATA Raw data can be entered into columns RD start- ing at row 17 (Fig. 2). These three rows correspond to the A-C apices shownin 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. Samplenumbers can be enteredin column A (Fig. 2). The normalized data are calculated from the unnormalized values (columns ED) and stored in columns H-J (Fig. 2). The x and y coordinate values used for plotting are calculated in columnsF and G. To reduce the initial size of the spreadsheet only, the first three rows (17-19) have the necessary formulae for the normalization and x,y coordinate calculations.As the user adds more points to the spreadsheet, the formulae in cells F19-J19 shouldbe copied to cells Fxx-Jxx, wherexx corresponds to the row number of any row containing unnormalized data. The user should not delete any columns or rowsof data asthe calculations for the axes (Figs. 1 and 2) and tick marks (columnsAN-AR) are performed in other areas of the spreadsheet and some cells crucial to the construction of the ternary diagram may be deleted inadvertently. Symbol shapes are limited to those available in Excel. Individual symbols are assigned to each data series asdefined in the Excelchart menu.In order to select different symbols, the user must define different series from the Chart, Edit series menusin Excel. The user is referred to the Excelhelpmenu or Excel documentation for further information on editing series and selecting symbol types. SCALING OF AXES AND TICK MARKS Axes can be scaledby changing the modifiable plotting parameters for the A and B scales (Fig. 2). Theminimum andmaximum scale for A (cells C9 and 697

Transcript of Ternplot: An excel spreadsheet for ternary diagrams

Page 1: Ternplot: An excel spreadsheet for ternary diagrams

Compufers & Geosciences Vol. 22, No. 6, pp. 697699, 1996 Cmvrieht (%1 1996 Elsevier Science Ltd Pergamon

PII: SOO98-3004(96)00012-X Printed’& drea;Britain. All rights reserved

0098-3004/96 $15.00 + 0.00

SHORT NOTE

TERNPLOT: AN EXCEL SPREADSHEET FOR TERNARY DIAGRAMS

DANIEL MARSHALL Department of Earth Sciences, Carleton University, Ottawa, KlS 5B6 Canada

(email: [email protected])

(Received 9 September 1995; revised 16 November 1993

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 com- patibles. Some packages are available, such as Igpet (Carr, 1995) Petro-talc plot (Sidder, 1994) Newpet (Clarke and others, 1994), Minpet (Richard, 1992), and Triplot (Baedke and Thompson, 1993), but these programs have limited scaling capabilities for the lengths of the axes and placement of tick marks. As most earth scientists are familiar with one of the commercially available spreadsheet programs, Tern- Plot was created in Excel 4.0. TernPlot offers the user scaleable axes, tick-mark increment, and length selec- tion, and diagrams can be output directly to a printer or transferred to drawing programs via the Windows Clipboard. 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 require- ments are an IBM PC compatible with Windows and Excel 4.0 (or 5.0), and a Windows 3.1 compatible printer. The program is available from the anony- mous FTP site IAMG.ORG.

SETUP

The use of particular printers, Windows installa- tions, and Excel versions occasionally result in small differences in the length of the ternary axes. To ensure that the default settings are consistent with your hardware, it is advisable to copy the file ternplotxls 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. l), which results in an increase or decrease in the length of th . B-C axis relative to the lengths of the A-B and A- (2 axes. A value of 75.00 produces axes of equal length for a wide variety of printers with Excel version 4.0. A value of 81 pro- duces axes of 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 RD start- ing at row 17 (Fig. 2). These three rows correspond to the A-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 ED) and stored in columns H-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-19) have the necessary formulae for the normalization and x,y coordinate calculations. As the user adds more points to the spreadsheet, the formulae in cells F19-J19 should be copied to cells Fxx-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 (Figs. 1 and 2) and tick marks (columns AN-AR) are performed in other areas of the spreadsheet and some cells crucial to the construction of the ternary diagram may be deleted inadvertently.

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 select different symbols, the user must define different series from the Chart, Edit series menus in Excel.

The user is referred to the Excel help menu or Excel documentation for further information on editing series and selecting symbol types.

SCALING OF AXES 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

697

Page 2: Ternplot: An excel spreadsheet for ternary diagrams

DATA FOR TRIANGLE BOUNDARIES DO NOT ERASE1 I

XY Screen/Prmter Correction Factor II.5 47

Figure 1. View of portion of TernPlot Excel spreadsheet showing cell (F341) used during installation of program to adjust length of axes in ternary diagram.

found m cells PS-X31 b double clicking_on the

*

Hodifiabls ulottins pararsters I 1 ltin 1 ! Ean

A-axisl 0.00 I 100 00 1 10 00 1 5 00 B-axis1 0.00 I Calcual.tcd. par

Raw data X-Plot Y-Plot Noraalised data B C value value %A %B %C

20.00 60.00 20 00 22 so .o 00 .:‘II 00 60 “0 20.00 40.00 40,oo 20 00 3 I ! r. d ! I 4j 00 Js r.! 0 !> 4!> 20 EU.IIO 20 00 40 00 40 00 37.50 20 00 20 00 40 00 40.00

Figure 2. View of portion of TernPlot Excel spreadsheet showing “user” modifiable plotting parameters, calculated plottirlg parameters, calculated normalized data (columns H-J), X-plot values (column F), Y plot values (column G), raw dala

(columns A-D) and embedded ternary diagram.

Page 3: Ternplot: An excel spreadsheet for ternary diagrams

Short Note 699

D9, respectively) and the minimum value for the B scale (cell ClO) may be changed. The other three parameters, the B maximum, C minimum, and C maximum are fixed by the choice of the modifiable plotting parameters (Fig. 2).

Up to a maximum of 25 tick marks per axis can be specified. The increment for the tick axis selection is given in cell E9 (Fig. 2). Tick mark length is deter- mined 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 tick marks outside the triangle.

AXIS 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 documentation for further information.

IMPORTING TO OTHER GRAPHICS PROGRAMS VIA THE CLIPBOARD

The graphics capabilities of Excel are limited com- pared to some other drawing programs, such as Core1 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 field 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 select “Select Chart.” Go to the “Edit” menu select “Copy.” Minimize the Excel program and open the drawing program. Core1 Draw version 4 is used here as an example: go to the “Edit” menu and choose “Paste Special,” then “Picture.” This imports the ternary diagram as an object and the user can enlarge or reduce the diagram to the desired size. However, the user should be careful to maintain the x-y aspect ratio during enlargement or reduction. To modify individual parts of the diagram, select the entire object (ternary diagram), go to the “Arrange” menu and select “Ungroup.” Click the mouse outside of the selected objects. Any portion of the ternary diagram can be selected for editing using the mouse.

REFERENCES

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

Carr, M., 1995, Program Igpet, Terra Softa Inc., Somerset, New Jersey, variously paged.

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: [email protected] or [email protected]

Richard. L.. 1992. Proaram MinPet v. 1.2: MinPet Geologi- cal Software, 146-du Chateau, Masson-Angers, PG, Canada, J8M 153. variously paged.

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