Start Submission Become a Reviewer

Reading: FastGAPP – A MATLABBased Program Supports Earth Scientists Interpreting Geochemical, Petrolo...


A- A+
Alt. Display

Software Metapapers

FastGAPP – A MATLABBased Program Supports Earth Scientists Interpreting Geochemical, Petrological and Sedimentological Data


Florian Riefstahl ,

University of Bremen, Department 5 Geosciences, Bremen; Alfred Wegener Institute Helmholtz Centre for Polar and Marine Research, Bremerhaven; Now at: Landesamt für Geologie und Bergwesen Sachsen-Anhalt, Halle, DE
X close

Felix Gross

Institute of Geosciences, Kiel University, Kiel; Center for Ocean and Society, Kiel University, Kiel, DE
X close


FastGAPP (Fast Geoscientific Analyses Plotting Program) is a MATLAB-based graphical user interface. It is developed to quickly explore and interpret geochemical major and trace element analyses of igneous rocks in over 100 published classification and discrimination plots, variation diagrams and normalised rare-earth element and multi-elements plots. All plots can be modified (fonts, lines, frame etc.) to produce publication-ready and high-quality raster or vector graphics. Among geochemical analyses of magmatic rocks, several other sub-programs are integrated to display petrographic analyses of igneous rocks, composition and grain size analyses of sedimentary rocks, and grain size analyses of soils. FastGAPP also provides several tools to support data handling, to extend the integrated geochemical databases and/or even create new sub-programs for different fields of geosciences. FastGAPP v2.0 is available on GitHub and Zenodo.

How to Cite: Riefstahl, F. and Gross, F., 2021. FastGAPP – A MATLABBased Program Supports Earth Scientists Interpreting Geochemical, Petrological and Sedimentological Data. Journal of Open Research Software, 9(1), p.11. DOI:
  Published on 31 May 2021
 Accepted on 13 May 2021            Submitted on 11 Jun 2021

(1) Overview


Geochemical studies of igneous rocks are fundamental to classify rock types in terms of main-, minor-, and trace element whole-rock chemistry. Together with petrographic thin section observations Earth scientists classify igneous rocks and draw conclusions about:

  • the petrogenesis and evolution of igneous rocks;
  • the thermal and barometric conditions in which primary magmas have formed;
  • the magmatic processes involved in the evolution of igneous rocks;
  • and the geotectonic environment in which igneous rocks might have formed.

The creation of publication-ready geochemical plots and comparison of own data with published are often extremely time-consuming, and therefore, inefficient and expensive tasks. Specific software to perform these tasks are mostly based on VBA and Excel like the programs Petrograph [1], PetroPlot [2], GeoPlot [3], GCDK [4], GCDPlot [5], or Geokit [6]. Other software approaches are developed in Python (GeoPyTool [7]) or R (GCDKit [8, 9]). Here, we present the program FastGAPP v2.0 (Fast Geoscientific Analysis Plotting Program), which is a MATLAB-based graphical user interface. FastGAPP v2.0 allows cross-platform, interactive and simultaneous exploration, comparison, and interpretation of up to 9 datasets. The principles of FastGAPP’s data handling are also suitable for other fields of geosciences and can increase teachability of geoscientific data visualisation and interpretation.

Implementation and architecture

FastGAPP v2.0 is MATLAB-based and consists of numerous functions, which are controlled and accessed by graphical user interfaces. The user is not required to have background knowledge in MATLAB programming. FastGAPP can be started by using the MATLAB command line or user interface. The FastGAPP start window is intended for the selection of sub-programs and their corresponding datasets. Once selected, each sub-program allows the input of up to nine different datasets. From these datasets, only the table data in the columns with valid header entries are imported into the sub-programs. Headers and units are usually described in the first and second row of the output file of the geochemical measurements delivered by laboratories. If this is not the case, the user needs to adjust these two rows in advance. The sub-program FastGAPP for displaying geochemical data can read up to 83 different headers (e.g. SiO2, TiO2, MgO…) and various different units (e.g. wt. %, ppm, ppb). Complete lists of all valid header entries and supported units for all sub-programs are listed in FastGAPP’s documentation. Among MS Excel spreadsheets, all sub-programs can also read data from MAT-files, which significantly decreases file import times during start-up. These MAT-files can be created from spreadsheets by using the integrated tools.

After the input datasets have been selected, it is possible to start the specific sub-program. This initiates a complex data processing flow (Figure 1): First, the previously-selected input files are parsed and sorted. Second, essential variables and structures are created. This includes a control structure in which headers (including units) and plot datasets for the selected sub-program are loaded. Additionally, a data structure is created by loading the default setup for markers and labels (Figure 1). Third, the datasets are imported dependent on their file type by using the corresponding MATLAB-commands (“load” for MAT-files and “xlsread” for spreadsheets). A simple loop, which uses the program-specific headers, parses through the imported input files and writes the information into new variables of the data structure. If a header value was not found in the imported data, these variables will be present as NaN’s (Not-a-Number). Fourth, the defaults for the appearance of plots lines and labels are loaded into the control structure. Finally, a special function performs a program-specific processing of the data. The special function of FastGAPP for example performs a volatile-free normalisation to 100 wt. % (including all trace elements given in ppm or ppb), a conversion of all major element oxides and trace elements to molar weights, and calculation of commonly used indices such as the ASI (alumina saturation index) or AI (agpaitic index). Additionally, statistics such as minimum, maximum, mean, and median for each element are calculated and stored in the data structure.

Figure 1 

FastGAPP’s data processing flow from sub-program and dataset selection to the start-up of the sub-program including the flow of the control and data structure.

After data processing and initialisation of all fundamental structures, the main window opens and handles the processed and calculated data (Figure 1). The main window (Figure 2) is mostly similar for all sub-programs. It allows to explore, display, and plot the imported data:

  1. The panel on the left side of FastGAPP’s main window (Figure 2) allows to select the currently imported datasets and available plots, to adjust the axes of the plot, to open the plot in new MATLAB window or to export vector and raster graphics (Figure 3).
  2. The central panels (Figure 2) give an overview and information about the imported datasets for every header and show a preview of the currently selected plot.
  3. The right panels (Figure 2) include a legend (also exportable as raster or vector graphics) and several control elements to adjust the plot appearance (Figure 2). The legend panel can be switched by selecting any dataset to another panel, which allow to adjust the appearance of marker and marker labels.
Figure 2 

Screenshots of the main window of FastGAPP v2.0 in overview mode (A) and dataset mode (B). The different panels give an overview about the imported data and allows to adjust markers, their labels, the plot lines and labels, and change the currently selected plot.

Figure 3 

Examples for final plots. The geochemical data are from dredged rocks from two locations along the Yermak Plateau north of Svalbard [11] compared to onshore Hansen Point Volcanics onshore Ellesmere Island, Arctic Canada [12] in different plots created with FastGAPP v2.0. (A) Total-alkalis vs. silica (TAS) diagram [13]. (B) 2*Nb-Zr/4-Y geotectonic classification diagram [14]. (C) Primitive mantle-normalised rare-earth elements (REE) plot [15].


FastGAPP allows to import up to 9 datasets into a single session of any sub-program. If 9 datasets are not enough, FastGAPP can also read information about marker and marker labels from the input data so that multiple datasets can be present in a single input file. The major improvements compared to the initial version of FastGAPP (v1.0) published on are (I) the automatic import of the data by program-specific headers from the input, (II) the support of MAT-files, (III) simplified export of raster and vector graphics, (III) full control of plot and marker appearance, (IV) improved data overview. FastGAPP supports multiple instances of the main windows at the time, which allows to work on more sessions at the same time. Furthermore, sessions can be saved and loaded as MAT-files. This simplifies sharing of specific sessions with other scientists and researchers.

The four sub-programs cover different fields of geosciences from examination of (I) geochemical analyses of major, minor and trace elements of igneous rocks (“FastGAPP”), (II) petrographic classification of igneous rocks (“PetroPlot”), (III) petrographic classification and provenance analyses of sedimentary rocks (“SediPlot”), to (IV) soil classification based on grain size analyses (“SoilPlot”). FastGAPP includes over 100 petrographic and geochemical classification, magma-series and geotectonic discrimination diagrams from over one century of petrological and geochemical research. Additionally, several integrated functions like the “MULTIPLotter” and the “PLOT-O-MAT” allow users to create rare-earth element (REE), multi-element plots and geochemical variation diagrams.

Furthermore, FastGAPP is extendable. The digitised plot datasets are stored as two-point line segments and field labels in separate MATLAB scripts. These can be created from Excel spreadsheets by using the development tools integrated in FastGAPP (Figure 1). The same possibilities for database extension apply for normalisation values necessary for REE and multi-element plots. Moreover, it is even possible to create new sub-programs for different fields of geosciences by using the development tools (Figure 1).

Quality control

FastGAPP has undergone extensive functional testing and debugging by F.R. during development. This included also tests with real, synthetic and nonsensical datasets. The majority of the functions contain logical if-else statements, which e.g. also allows import of datasets with incorrect header or unit information without any conflicts with main data processing flow.

First plots with a stable version of FastGAPP are already presented in Geissler et al. [10]. The download package contains sample data for all sub-programs and software documentation provide sufficient details that other scientists can quickly understand and step-by-step work with FastGAPP v2.0.

(2) Availability

Operating system

The software has been tested on Windows 7, 8 and 10 and Mac OS X.

Programming language

FastGAPP is written in MATLAB code, and therefore is not required to be compiled. Tests were performed with the MATLAB versions 2013 (Windows 10), 2015 (Mac OS X) and 2020 (also Windows 10).

Additional system requirements

The disk space of the zipped download is only 25 MB. The system requirements are those recommended for MATLAB installations (minimum 3.1 GB minimum, 4 GB RAM, any Intel or AMD x86-x64 processor).


FastGAPP requires only MATLAB (without any further add-ons or packages) and MS Excel to be installed on the platform.

List of contributors

No further scientists/researchers contributed to the development of FastGAPP.

Software location


Name: Zenodo

Persistent identifier:

Licence: GNU General Public License v3.0

Publisher: Florian Riefstahl & Felix Gross

Version published: Version 2.0

Date published: 12/03/2020

Code repository

Name: GitHub


Licence: GNU General Public License v3.0

Date published: 11/11/2019


FastGAPP and its documentation is written in English. Further support is also possible in German.

(3) Reuse potential

FastGAPP is publicly available on GitHub and Zenodo. Preparation of input datasets for the different sub-programs is accessible for most users with geoscientific background by using the program-specific headers in the first row (i.e., SiO2, TiO2, Zr, Nb, etc.) with their corresponding units in the second row (i.e., wt. %, %, ppm, ppb, etc.). Therefore, input data match or are close to geochemical datasets provided by the geochemical laboratories.

The program contains a high number of available published geochemical and petrographic plots for igneous rocks from over one century of petrological research. Moreover, FastGAPP covers more disciplines of geosciences since it also contains sub-programs for sedimentological classification, sediment-source discrimination and soil classification.

For advanced and interested users, FastGAPP also provides development tools, which make it possible to enhance the databases of plots and geochemical normalisation values or even to create new programs for other fields of Earth science. The functionality of the development tools is also listed and explained in FastGAPP’s documentation.

The authors invite ideas for improvements in future versions of FastGAPP and report of any bugs. Please contact the lead author via email if support beyond the documentation and manual is required. This also applies if you are considering code modifications, enhancements of databases or further development.


We thank Daniel Zitterbart (Alfred Wegener Institute/Woods Hole Oceanographic Institute) for some suggestions and comments on the code functionality and code efficiency. Furthermore, we thank the research groups ‘Geodynamics of the Polar Regions’ and ‘Petrology of the Ocean Crust’ of the University of Bremen for productive and positive feedbacks during the presentation of early development versions of FastGAPP v2.0. Their suggestions improved the FastGAPP program significantly. We also like to thank the two anonymous reviewers and the editor for positive and constructive feedback.

Funding statement

The development of FastGAPP did not receive any funding.

Competing interests

The authors have no competing interests to declare.


  1. Petrelli M, Poli G, Perugini D, Peccerillo A. PetroGraph: A new software to visualize, model, and present geochemical data in igneous petrology. Geochemistry, Geophysics, Geosystems. 2005; 6(7): 542–557. DOI: 

  2. Su Y, Langmuir CH, Asimow PD. PetroPlot: A plotting and data management tool set for Microsoft Excel. Geochemistry, Geophysics, Geosystems. 2003; 4(3): 1030. DOI: 

  3. Zhou J, Li X. GeoPlot: An Excel VBA program for geochemical data plotting. Computers & Geoscience. 2006; 32(4): 554–560. DOI: 

  4. Qiu J-T, Song W-J, Jiang C-X, Wu H, Dong RM. CGDK: An extensible CorelDRAW VBA program for geological drafting. Computers & Geoscience. 2013; 51(2): 34–48. DOI: 

  5. Wang X, Ma W, Gao S, Ke L. GCDPlot: An extensible microsoft excel VBA program for geochemical discrimination diagrams. Computers & Geoscience. 2008; 34(12): 1964–1969. DOI: 

  6. Lu YF. GeoKit: a geochemical toolkit for Microsoft excel. Geochimica. 2004; 33(5): 459–464. 

  7. Yu Q-Y, Bagas L, Yang P-H, Zhang D. GeoPyTool: A cross-platform software solution for common geological calculations and plots. Geoscience Frontiers. 2019; 10(4): 1437–1447. DOI: 

  8. Janoušek V, Farrow CM, Erban V. GCDkit: new PC software for interpretation of whole-rock geochemical data from igneous rocks. Geochimica et Cosmochimica Acta. 2003; 67(A186). 

  9. Janoušek V, Farrow CM, Erban V. Interpretation of Whole-rock Geochemical Data in Igneous Geochemistry: Introducing Geochemical Data Toolkit (GCDkit). Journal of Petrology. 2006; 47(6): 1255–1259. DOI: 

  10. Geissler WA, Estrada S, Riefstahl F, O’Connor JM, Spiegel C, Van den Boogard P, Klügel A. Middle Miocene magmatic activity in the Sophia Basin, Arctic Ocean — evidence from dredged basalt at the flanks of Mosby Seamount. arktos. 2019; 5(1): 31–48. DOI: 

  11. Riefstahl F, Estrada S, Geissler WH, Jokat W, Stein R, Kämpf H, Dulski P, Naumann R, Spiegel C. Provenance and characteristics of rocks from the Yermak Plateau, Arctic Ocean: Petrographic, geochemical and geochronological constraints. Marine Geology. 2013; 343: 125–145. DOI: 

  12. Estrada S, Henjes-Kunst F. Volcanism in the Canadian High Arctic related to the opening of the Arctic Ocean. Zeitschrift der Deutschen Geologischen Gesellschaft. 2004; 154: 579–604. DOI: 

  13. Le Bas MJ, Le Maitre RW, Streckeisen A, Zanettin B. A Chemical Classification of Volcanic Rocks Based on the Total Alkali-Silica Diagram. Journal of Petrology. 1986; 27(3): 745–750. DOI: 

  14. Meschede M. A method of discriminating between different types of mid-ocean ridge basalts and continental tholeiites with the Nb*2-Zr/4-Y diagram. Chemical Geology. 1986; 56(3–4): 207–218. DOI: 

  15. Sun S-s, McDonough WF. Chemical and isotopic systematics of oceanic basalts: implications for mantle composition and processes. Geological Society of London Special Publications. 1989; 42(1): 313–345. DOI: 

comments powered by Disqus