Otwarty dostęp

MinPlotX: A powerful tool for formula recalculation, visualization, and comparison of large mineral compositional datasets

 oraz   
21 lut 2025

Zacytuj
Pobierz okładkę

Introduction

Analysis and visualization of mineral chemical data are essential to studies in mineralogy, petrology, volcanology, economic geology, and beyond. Microanalytical instrumentation is increasingly accessible, resulting in extensive mineral chemical datasets. Therefore, there is an increasing need for a simple, robust, and effective way to recalculate and visualize mineral compositional data. Walters (2022) published MinPlot, a MATLAB®-based command-line program for mineral formula recalculation and mineral plotting. MinPlot was quick and easy to use, backwards compatible, and produced publication ready plots. However, the command-line approach limited the functionality, such as a select few streamlined options available to the user and the inability to plot multiple different types of data simultaneously. Additionally, MinPlot required a MATLAB® license to run and was therefore unavailable to many potential users.

Here we present the improved MinPlotX, a graphical user interface (GUI) based standalone program for mineral formula recalculation and compositional plotting (Fig. 1). The addition of an easy-to-use GUI, in combination with an application programming interface (API), provides greatly increased flexibility and customizability. For example, users can now design and edit their own plots in addition to using pre-defined plots or programmatically process their data using routines and functions as needed for complex or reoccurring datasets. MinPlotX also allows the import of numeric or categorized metadata, which can be used to organize plots by various parameters, such as sample name, rock type, or analysis location. MinPlotX currently offers recalculation and structural formula assignment for 21 different minerals/mineral groups: allanite, amphibole, apatite, chlorite, chloritoid, cordierite, epidote, feldspar, garnet, ilmenite, lawsonite, mica, olivine, oxyspinel, pyroxene, scapolite, serpentine, staurolite, sulfides, talc, and titanite. However, the program is designed as a mineral chemistry platform and new recalculation and plotting schemes can be easily added by advanced users. Here we try to create a community-based open-source approach that allows MinPlotX to grow with the needs of the broader geoscience community. To assist users in this process, we have included example functions that can be easily modified for both new mineral recalculations and custom plots.

Figure 1.

The program structure of MinPlotX, including main user interface, as well as the QuickPlot, EasyPlot, VisModule, AdvancedPlot Module, GeoCPlot, and SpotVis modules.

Program Design

MinPlotX is redesigned and programmed in MATLAB® (R2021b) using the MATLAB® App Designer. Compiled standalone applications are available for Windows, MacOS, and Linux. The general formula recalculation, ferric iron estimation, and endmember calculation procedures are largely the same as in Walters (2022) and are not repeated here. Updates and refinements to calculations, as well as the addition of new minerals, are discussed in depth in the supporting documentation, which can be accessed in two ways: 1. From within the MinPlotX GUI itself, and 2. As PDFs included in the MinPlotX Installation directory. A quick start guide for new users is also available in the supporting documentation. Here we will focus on improvements to functionality and ease of use allowed through the new GUI and modular design.

Input data

The core input data consists of oxides of major and minor elements and are loaded into MinPlotX as tabulated data files (.csv, .txt., or .xlsx). We include examples of input files with MinPlotX for natural and synthetic (calculated from ideal stoichiometry) data. Like MinPlot v1.0 (Walters 2022), some elements are mandatory for a given mineral (e.g., SiO2 in silicates), whereas others are optional (e.g., SrO in feldspar, K2O in pyroxene). For all H2O and CO2 bearing phases, it is now possible to include measured weight percents of these elements. For increased flexibility, options are available for multi-valent Fe and Mn for minerals in which oxidation states of these elements are important and variable. The M3+/ΣM ratio, where M is a metal cation, can be included as metadata (headers: ‘Fe3_ratio’, ‘Mn3_ratio’) or assigned as a global value applied to all analyses. For minerals that can incorporate tetrahedral Fe3+, the ratio of tetrahedral Fe3+ to total Fe3+ can be given as metadata (header: ‘tetra_Fe3’) or as a global value. These options allow for Fe and Mn oxidation state analysis by techniques such as Mössbauer spectroscopy, X-ray absorption spectroscopy, of ‘flank method’ EPMA (e.g., Dyar et al. 2006; Höfer, Brey 2007; Wilke et al. 2001) to be combined with EPMA data in MinPlotX. Alternatively, charge balance Fe3+ estimation is also available for selected minerals. The ‘Input/Output’ documentation in MinPlotX gives a table of all possible inputs and outputs for each mineral function, whereas the ‘Documentation’ file gives a detailed description of the treatment of multivalent elements, normalization procedure, endmember calculation, and predefined classification/composition plots for each mineral. Finally, since elements with concentrations below detection make negligible contributions at the apfu level, data in the form of <X.XX wt % or not a number (NaN) are converted to zero.

Metadata are a powerful tool in MinPlotX and both text and numeric entries of any kind are allowed. These metadata can include those produced during EPMA analysis, as well as additional metadata added manually by the user. For example, sample name, spot location (e.g., core, mantle, rim), rock type, and transect distance to name a few (see later examples) can be added. Once the input file is loaded, metadata can be used to organize, classify, and plot data in both the predefined classification/composition and user defined plots. To help import metadata we included the MergeTableModule in which the user can select columns that share same unique string, which we call a “Unique Correlation Identifier (Unicorn).” The Unicorn helps users combine spatially referenced data from different instruments (e.g., EPMA and LA-ICPMs analyses on the same domain). Users may specify a Unicorn, for example, “Sample_subsample_mineral_grainnumber_position_or_texturalcontext.”

Input files can include data for a single type of mineral or multiple minerals. For data organized into files by mineral type, MinPlotX will check the file name for mineral names and automatically assign the correct formula recalculation procedure. These data are calculated in the Main tab. For multi-mineral files, a metadata column of ‘mineral’ should be included, and these data can be processed under the MultiMineralCalc tab. In this case, the settings for each mineral and row can be set individually in the input table. Finally, the name must match one of the supported minerals in MinPlot.

Software structure and workflow

MinPlotX is a GUI-based program that acts as a platform for various mineral formula recalculation and plotting tools (Fig. 1). The main MinPlotX window covers data handling (e.g., loading data, deleting data), data organization (e.g., selection of specific samples or minerals in the MultiMineralCalc window), and calculation and assignment of atoms per formula unit (apfu) to mineral structural formulae. In a typical workflow, input data would be first loaded into the main interface, after which the mineral formula is calculated (Fig. 2a). The initial input data remain unaffected by any calculation procedure. As a result, the calculation settings can be changed and the data recalculated without the need to re-upload the original datafile (Fig. 2a). Minerals are not automatically identified from their compositions. Instead, each analysis uses a mineral specific recalculation and plotting routine that is defined by the user. For analyses where the mineral is not known, an unknown function is available that can recalculate any set of oxide wt % into apfu using either a cation or anion normalization procedure (see documentation). The oxide weight percents and other numeric metadata can also be manipulated using the DataCalculatorModule function. When the calculator function is used, the original input data are unaffected and a new column with the transformed data is added. Following any calculations, the ExportModule is used to select and compile the output data (e.g., wt % oxides, apfu, structural formulae) and metadata (e.g., sample name, calculation options, etc) into a single output file in any directory (Fig. 2a).

Figure 2.

Typical workflow of data import, organization calculation and export (a) and different visualization options to generate publication ready figures (b).

There are six modules available for visualization that offer varying degrees of simplicity, user input, and efficiency (Fig. 1). The user can select predefined plots or make their own. In a typical workflow, the user might first consider the predefined mineral compositional and classification plots that are included in MinPlotX (Fig. 2b). These cover a wide range of mineral-dependent plots commonly used in the literature (e.g., anorthite-albite-orthoclase ternary, amphibole classification diagrams). Mineral specific diagrams can be output in multiple ways. For example, QuickPlot outputs all predefined two dimensional plots into a single figure where all data points have the same symbol type, size, and color, allowing users to quickly check mineral compositions. Selecting EasyPlot produces the predefined plots as individual figures, and it is possible to plot data from multiple input files. Custom diagrams are also available and include scatter (XY, XYZ), line transects, ternary, tetrahedral and multi-layout plots (Fig. 2b). The VisModule option allows the user to create any kind of custom diagram and is the module intended for producing line transects. For line transects, the user can either plot data points on the X axis as 1 to n or by including a metadata column for profile distance. The AdvancedPlotModule offers both predefined mineral specific diagrams and the option to create custom mineral specific plots. Importantly, the AdvancedPlotModule allows users a wide range of subdivision, filtering, and classification options using metadata, as well as greater flexibility when generating custom plots. For example, individual samples can be given unique symbol types and colors, and different classification approaches can be visualized in the same plot. Data subdivision and filtering (using the Histogramfilter) is also available in the VisModule for custom plots. Full customization of the predefined mineral specific diagrams can be done using the AdvancedPlotModule. Other plotting options include the SpotVisModule module, which plots mineral compositions spatially using the X–Y coordinates recorded by the EPMA software. Additionally, GeoCPlot module (modified after Gies et al. 2024) allows for classification and filtering using either metadata or a clustering algorithm and plots a scatterplot matrix of all possible XY combinations of selected mineral compositional parameters or metadata. In the final workflow stage (Fig. 2b), outputs from EasyPlot, VisModule, and AdvancedPlotModule are all loaded into the EasyPlotModule. There users can edit the plots (e.g., edit symbols, adjust symbol appearance, adjust legend entries, reorder ploted objects, or impose custom axis limits) and export figures. Plots can then be exported to any directory and as a variety of file types (e.g., .pdf, .tif, .jpg, etc.). Saving figures as .pdf or .eps allows them to be further manipulated by vector graphics programs.

Customizability and community-driven approach

The customizable and extensible design of MinPlotX enables users to incorporate their own mineral specific recalculation functions and visualization routines with minimal modifications or additions to the provided functions and definition files. No changes to the source code are required to integrate the user specific modifications to the graphical user interface. Further, the modular and function-based programming structure of MinPlotX also allows users to implement own or existing MATLAB® routines and functions in MinPlotX. Addition of new mineral recalculation and visualization routines to the uncompiled version requires a MATLAB® license and then recompiling of MinPlotX. Thus, MinPlotX can be used for customized data processing routines for personalized advanced data processing, mineral formula recalculation, and visualization. In addition, our approach here is community driven: we encourage users to create and share recalculation functions and visualization routines, thereby promoting collaboration and expanding the mineralogical toolbox of future releases of MinPlotX. Further information can be found in the source code of MinPlotX, the documentation of the application programing interfaces (API), and the user guide.

Data visualization in MinPlotX

MinPlotX is a vast improvement over MinPlot (Walters 2022) by offering greater ease of use, flexibility, and options for both mineral specific and custom plots. The strength of MinPlotX is the ability to quickly and easily examine different kinds of relationships between mineral composition and various other types of metadata, such as different samples, mineral textures, rock type, age, and many others. The metadata can be independent of the type of input file or data source. Such an approach is particularly useful for studies where mineral compositions need to be linked to petrogenesis, deformation, time, or where many different samples are investigated. Below we show three different applications of how data and metadata can be combined in MinPlotX to investigate and visualize mineral compositional relationships.

Linking mineral compositions and textures

MinPlotX can be used to easily visualize the relationship between mineral chemistry and metamorphic history. Our example is that of a polymetamorphic terrane from Western Maine, USA as published in Walters et al. (2022). The paragneiss sample underwent high-temperature metamorphism and partial melting during the Acadian orogeny between 425 and 370 Ma, followed by a lower pressure – temperature (P–T) rehydration and retrograde metamorphic event at around 295 Ma during the Alleghanian orogeny (Walters et al. 2022). The matrix of the rock contains biotite, plagioclase, quartz, whereas biotite, sillimanite, plagioclase, and quartz are observed as inclusions in garnet. A profile for garnet is given in Figure 3a. Inclusions were filtered using the HistogramFilter in VisModule to remove data that did not have totals of 99–101 % (cross-symbols in Fig. 3a). The garnet profile reveals the modification of an initially flat zoning profile formed during the Acadian-Neoacadian event during retrograde metamorphism and hydration in the Alleghanian. The exchange of Fe and Mg between garnet and biotite is temperature sensitive and is the basis for the garnet-biotite thermometer (Ferry, Spear 1978). According to this exchange, volume diffusion during cooling should increase Fe in garnet and Mg in biotite. However, garnet grains here exhibit core-to-rim decreases in both XAlm and XPrp, whereas XSps increases (Fig. 3a,b). Additionally, biotite in the matrix has lower XMg and F (apfu) and higher Ti compared to biotite inclusions (Fig. 4). Therefore, both minerals have trends inconsistent with volume diffusion and Fe and Mg exchange alone.

Figure 3.

(a) A Garnet transect with the fractions of almandine (XAlm), grossular (XGrs), pyrope (XPrp), and spessartine (XSps) endmembers. Data are filtered for analyses impacted by inclusions (grey X's). (b) EPMA X-ray intensity map showing the distribution of Mg in garnet. (c) X-ray intensity map illustrating higher Mg contents (red) of biotite inclusions in garnet compared to low Mg (blue) matrix biotite. Matrix biotite grains are observed to have homogenous compositions. Data are from Walters et al. (2022).

Figure 4.

Plots of (a) AlM (apfu), (b) Ti (apfu), and (c) F (apfu) vs XMg for biotite. Data are subdivided between analyses of inclusion (red diamonds) and matrix biotite (blue circles). Isolines of eastonite (Eas), annite (Ann), siderite (Sid), and phlogopite (Phl) endmember proportions are also plotted in (a). Data are from Walters et al. (2022).

The increase in Fe and Ti in the matrix biotite requires garnet resorption during retrograde net-transfer reactions (Kohn, Spear, 2000). This has significant implications for thermobarometry: If garnet compositions are affected volume by diffusion alone, then pairing analyses of high XMg garnet cores with matrix biotite would give the best estimate of the minimum peak temperature (see review in Kohn, Spear 2000). Combining the garnet-biotite thermometer of Ferry, Spear (1976) with the Berman (1990) garnet activity model and the garnet-biotite-quartz-plagioclase barometers (R1 & R2) of Hoisch (1990) gives a P–T estimate of ~900 °C at 500 MPa, conditions that would stabilize cordierite and orthopyroxene, which are not observed (Walters et al. 2022). In this case, the retrograde net-transfer reaction results in an unrealistically high peak T analysis because the increase of Fe in biotite relative to garnet shifts the equilibrium constant to higher T (Kohn, Spear 2000). One solution is to correct the composition of the matrix biotite for the amount of garnet consumed during retrogression (Kohn, Spear 2000). Alternatively, biotite inclusion-garnet core pairs may give the best P–T estimate of the Acadian high-T event. Biotite inclusions with intermediate XMg, AlM, Ti, and F (Fig. 4) are in contact with low XPrp garnet (Fig. 3b,c), suggesting that these inclusions have partially reset by reacting with the garnet host. Smaller biotite inclusions are not in contact with locally reset garnet and exhibit the highest XMg AlM, and F, and lowest Ti. Combining the garnet-biotite thermometer with the garnet-aluminosilicate-quartz-plagioclase barometer of Hodges & Crowley (1985) for pairs of high XMg garnet and biotite gives 630–700 MPa and 725–740 °C, consistent with the peak Acadian assemblage of garnet, biotite, plagioclase, sillimanite, and quartz and a maximum temperature of 800 °C calculated by Zr-in-titanite thermometry for titanite from calcsilicate lenses (Walters et al. 2022).

Combining geochronology and mineral chemical datasets

A powerful application in MinPlotX is the combination of major and minor oxide mass fractions with spatially correlated data collected on other instruments, such as secondary ion mass spectrometry or laser ablation inductively coupled plasma mass spectrometry. For example, single spot ages may be linked with previous EPMA measurements on the same domains. In minerals such as monazite, titanite, allanite, apatite, and garnet (U-Th-Pb geochronology) and mica (Rb-Sr geochronology), trends in major element contents, site assignments, and endmember fractions can be used to link ages to changes in chemical environment, deformational histories, or P–T paths. The latter is particularly important, as conventional thermobarometery and thermodynamic modelling are based on the distribution of the major rock-forming elements (see review in Powell, Holland 2008).

Titanite is a common accessory phase in igneous and metamorphic rocks and can be dated by U-Pb geochronology (see review in Kohn 2017). Ages can be linked directly to P–T histories by combining Zr-in-titanite thermometry and TZARS (titanite-anorthite-clinozoisite-rutile-quartz) barometry (Hayden et al. 2008; Kapp et al. 2009). Titanite ages have been interpreted in the context of neocrystallization and growth (e.g., Castelli, Rubatto 2002; Corfu 1996; Kohn, Corrie 2011; Walters, Kohn 2017), dissolution-reprecipitation reactions (e.g., Garber et al. 2017; Holder, Hacker 2019; Walters et al. 2022), and deformation induced recrystallization (e.g., Gordon et al. 2021; Papapavlou et al. 2017; 2018). In addition to U-Pb age, these processes also influence major element chemistry. The most significant substitution in titanite is that of (Al, Fe)3+ + (OH, F) for Ti4+ + O2−, which is readily observed in plots of Ti (apfu) vs Al + Fe3+ (apfu) and F (apfu) vs Al + Fe3+ (apfu; Franz, Spear 1985; Ribbe 1980). Therefore, variations of Al and Fe in titanite are closely linked to changes in fluid chemistry (Franz, Spear 1985; Garber et al. 2017; Walters et al. 2022).

U-Pb analysis of titanite from calc-silicate lenses in western Maine revealed four textural-compositional-age domains at ca. 397, ca. 370, ca. 342, and ca. 295 Ma, spanning the Acadian and Alleghenian orogenies (Walters et al. 2022). Here we link single spot titanite U-Pb ages to the corresponding major element chemistry as measured by EPMA. In Figure 5, we observe that titanite Al + Fe3+ and F contents increase with decreasing U-Pb age. Importantly, the F/(F + OH) ratio also decreases from ~1.0 to ~0.8 over the same time interval. The shift in titanite compositions corresponds to a change from the high-T and high-XCO2 peak metamorphic assemblage of diopside, anorthite, alkali feldspar, and calcite, formed during the (Neo-)Acadian events (400-370 Ma), to the low-T and low-XCO2 assemblage of tremolite, clinozoisite, and albite formed during the Alleghenian (ca. 300 Ma) event (Walters et al. 2022). The infiltration of H2O-rich fluids, probably from the cooling of nearby plutons, drove the decrease in XCO2 and increase in titanite OH contents at this time. The same process is responsible for the hydration and retrogression of the metapelitic gneisses discussed in the last section. This example demonstrates how valuable and easy the combination of geochronologic data is using MinPlotX. The flexibility to combine any kind of metadata with major element mineral chemistry is one of the most important and useful features of MinPlotX.

Figure 5.

Plots of (a) Ti (apfu) and (b) F (apfu) vs Al + Fe3+ (apfu) plotted for titanite. Data are color contoured based on their associated single spot U-Pb age (for details see Walters et al. 2022). In (b), isolines of F/(F + OH) are also shown.

Working with databases

Increased access to micro-analytical facilities combined with increasingly rapid analyses has led to large volumes of published mineral chemical data. In recent years, large mineral datasets have been developed through datamining of modern and legacy mineral chemical data (e.g., Chiama et al. 2023; Dubacq, Forshaw 2024; Forshaw, Pattison 2021; Scibiorski, Cawood 2021; Suggate, Hall 2014). These databases are powerful tools for chemical fingerprinting the source of minerals of unknown origin. Mineral major element, trace element, and isotopic data are regularly used for provenance analyses of detrital minerals in sediments (e.g., Scibiorski, Cawood 2021; Schönig et al. 2021; Suggate, Hall 2014; van Hinsberg et al. 2011), artifacts made of geomaterials (e.g., Boschetti et al. 2022; Schertl et al. 2018), and gemstones (e.g., Dutrow et al. 2024; Groat et al. 2019).

In MinPlotX, it is possible to load and perform mineral formula recalculation for large mineral compositional datasets (10,000's to 100,000's of analyses). These data can be subdivided and overlaid with additional data, allowing for comparisons between datasets of various size and origin. For example, here we filter the garnet database of Chiama et al. (2023) for data that 1. include the full suite of necessary major elements and 2. have reasonable total weight percents. In Figure 6, we plot the almandine + spessartine, pyrope, grossular ternary diagram for metamorphic garnet data from schists (n = 11,994), migmatites (n = 97), and granulites (n = 650). The compositions of garnet in migmatitic paragneiss from Maine (from Fig. 3a) plot at high XAlm+Sps (> 0.8) and low XGrs (<0.05) and XPrp (>0.20), overlapping at the boundary between the schist and migmatite garnet datasets (Fig. 6). In contrast, analyses of garnet from eclogitic metagabbro (Walters et al. 2019; 2021) plot at XAlm+Sps = 0.4–0.5, XGrs = 0.15–0.35, and XPrp = 0.2 – 0.4 and overlap with only the most grossular-rich garnet analyses in the granulite field (Fig. 6). It is unsurprising that eclogitic garnet analyses fall outside of the database range given here, as these data are sourced from rocks that underwent different P–T conditions and have very different bulk compositions. However, these data demonstrate that, at least in our simplistic example, garnets from regionally metamorphosed medium- to high-grade metapelitic rocks can be distinguished from those in other tectonic settings. Therefore, such a comparison could also be made for garnets of unknown origin and assist in visualizing the results of provenance studies.

Figure 6.

The lower half of the XAlm+Sps, XGrs, and XPrp ternary for garnet is shown. Filtered data from Chiama et al. (2023) are given for schist (yellow circles), migmatite (purple circles), and granulite (red circles) are displayed. Garnet data for the migmatitic paragneiss displayed in Fig. 3a (blue diamonds) and metagabbroic eclogites (green triangles) are given. Example data are from Walters et al. (2019; 2021; 2022).

Conclusion and future direction

MinPlotX is a powerful tool for mineral formula recalculation and visualization of mineral chemical datasets. The transition to a GUI-based environment has allowed significantly more flexibility for formula recalculation, plotting, and modification of plots compared to MinPlot (Walters 2022). Like its first incarnation, MinPlotX is a modular program, this means that the addition of new data processing and visualization modules, as well as formula recalculation schemes and mineral specific plots, is simple for users who are familiar with MATLAB®. We hope that this design encourages community engagement, adding to the future development of MinPlotX. The GUI-based approach allows access to end users who have no programming experience or access to MATLAB®. Finally, the API enables advanced user to integrate functions of MinPlotX into their own data processing routines.

In the next stage of development, we will include modules for statistical discrimination, which will add a more quantitative aspect to the visual tools that are currently provided. Additionally, propagation of analytical uncertainties, probability contouring of large datasets, and addition of trace elements, whole rock data and routines to investigate spatially resolved datasets are under development and will be included in future updates to MinPlotX.

Code Availability

MinPlotX and its source code are available in a GitHub repository: https://github.com/NilsGies/MinPlotX. Compiled versions are available for Windows, MacOs and Linux.

Język:
Angielski
Częstotliwość wydawania:
1 razy w roku
Dziedziny czasopisma:
Nauki o Ziemi, Geofizyka, Nauki o Ziemi, inne