PiperStiff-EXPLAIN v10
PiperStiff-EXPLAIN v10
Piper and Stiff diagrams are plotted and mapped, respectively from water-quality
concentrations in milligrams per liter (mg/L). The program converts mg/L to
milliequivalents per liter (meq/L). Concentration of major ions are summed for
total dissolved solids (TDS) and charge balances are computed. Sites are
highlighted if charge balances exceed a user-specified threshold. Constituent
concentrations and TDS from a site can be selected and highlighted in the Piper
plot (Figure 1). A Stiff diagram is displayed for the selected site.
P a g e 1 | 20
Figure 2.— Stiff diagrams as presented in Google Earth.
Diagnostic Stiff diagrams also can be created in a new workbook, where each site
in a group is diagrammed in a single plot (Figure 3). A page is created for each
group of sites with an open Stiff diagram of individual ions for each site.
Milliequivalents of anions are plotted as negative values in Cartesian plots and are
inverted on log plots.
P a g e 2 | 20
Figure 3.—Diagnostic Stiff diagrams for groups of sites that are created in a new workbook.
Suggested Citation
Halford, Keith, 2024, Piper and Stiff–A workbook for creating Piper plots and Stiff
diagrams, version 10, Halford Hydrology LLC web page, revised July 2024, at
https://halfordhydrology.com/piper-and-stiff/
Revisions
October 28, 2019—Revisions in version 2 include the following. Sites can be
labeled with numbers rather than just text. Specified minimum and maximum
values of milliequivalents per liter in Stiff chart are transferred to minimum and
maximum values in Stiff icons that are displayed in Google Earth.
P a g e 3 | 20
November 25, 2019—Revisions in version 3 include the following. Site names are
checked for uniqueness. Non-unique site names are made unique by appending
occurrence number to repeated site names. For example, sites MW-A, MW-A, and
MW-A will be changed to sites MW-A, MW-A2, and MW-A3.
January 19, 2020—Revisions in version 4 include the following. Macro for writing
KMZ was revised so CONTROL sheet with icon chart is activated and refreshed
prior to writing images to graphic files. Stiff images sometimes did not appear or
appeared as X’s prior to this bug fix.
April 9, 2020—Revisions in version 5 include the following. Macro for writing KMZ
was revised so sites can be identified with numerical values such as dates. Site
identifiers appear as decimal days from 1/1/1900 if a user insists on using dates
as a site name. Percentage calculations in columns AL:AQ on the hidden
CONTROL page were revised to treat empty cells as 0 for unspecified chemical
concentrations. Both revisions are less bug fixes than enabling less than ideal
usage of the workbook.
July 29, 2020—Revisions in version 6 include the following. CONTROL page is
left visible so KMZ macro momentarily can activate page prior to writing STIFF
images from chart in range BT1:BV2. Stiff images previously sometimes did not
appear or appeared as X’s prior to this bug fix. Manually activate the CONTROL
page and return to the PIPER page if this error occurs.
January 1, 2021—Revisions in version 7 include the following. Macro for writing
KMZ was revised so decimal delimiters in longitude and latitude are written with
periods (.) regardless of regional settings in Excel. Thanks to Casper Zoete for
identifying and fixing this bug. Functions for plotting Stiff diagrams on a log scale
of the X-axis and creating diagnostic Stiff diagrams in a new workbook were
added.
May 1, 2021—Revisions in version 8 include the following. Minor correction so
that empty columns do not cause diagnostic Stiff macro to fail. Added discussion
about entering data as values in a block rather than dragging cells all over the
data page.
May 4, 2021—Revisions in version 9 include the following. Macro for writing KMZ
was revised so decimal delimiters in icon scales and geochemical summaries are
written with periods (.) regardless of regional settings in Excel. Thanks to Eduardo
Díaz Jiménez for identifying and fixing this bug.
July 10, 2024—Revisions in version 10 include the following. List of ions was
expanded to include Boron (B³⁺), Manganese (Mn²⁺), Copper (Cu⁺), and Iron
(Fe²⁺). These ions were specified in cells B17:F20 on the CONTROL page, which
is normally hidden. Plottable ions were expanded from 10 to 14 on the DATA
page. Further expansion is possible, but not advised. Piper plot labels are
unwieldy with greater than 10 ions and likely to become inky masses with greater
than 14 ions. Revision at request of Sam North, New South Wales Department of
Primary Industries.
P a g e 4 | 20
PiperStiff-QW-2019.xlsm Workbook
The workbook consists of two visible pages, DATA and PIPER, and one hidden
page, CONTROL. The hidden CONTROL page contains code for translating
coordinates and users should not need to edit the page. The table for converting
mg/L to meq/L is the exception if a constituent exists other than Bicarbonate
(HCO₃⁻), Calcium (Ca²⁺), Carbonate (CO₃⁻), Chloride (Cl⁻), Fluoride (F⁻),
Magnesium (Mg²⁺), Potassium (K⁺), Sodium (Na⁺), Sulfate (SO₄²⁻), Boron (B³⁺),
Manganese (Mn²⁺), Copper (Cu⁺), and Iron (Fe²⁺).
DATA page
Longitude, latitude, data group, site name, and chemical concentrations are
specified for each site in columns A-R and from row 15 and down (Figure 4).
Longitude and latitude are optional, but KMZ file will not be written without a
longitude and latitude for all sites. Groups define series in Piper plot (Figure 1)
and Stiff icons of similar color in KMZ file (Figure 2). Columns of chemical
concentrations can be ordered to suit user’s data sets by changing headings in
rows 13 and 14 through pull-down menus. Rows of site data are highlighted where
charge balance exceeds a user-defined threshold, cell U12, which is 5 percent in
the example (Figure 4).
Figure 4.—DATA page in the PiperStiff-QW-2019 workbook where longitude, latitude, data
group, site name, and chemical concentrations are specified for each site.
Data Page
P a g e 5 | 20
All data for a site is entered on a
single row before pasting into
workbook.
Paste your data to cell to A15 or C15
if longitude and latitude are not
included.
P a g e 6 | 20
Criteria for excessive charge
imbalance is specified with a pull-
down menu in cell Q12.
P a g e 7 | 20
PIPER page—Piper plot
Piper plot and plotting controls are displayed on the PIPER page (Figure 5). A
unique list of groups is created and corresponding series in the Piper plot are
formatted with the refresh button (cell J2). Symbol colors are assigned by fill
colors in column J and are filled with colors in column K if colored. Groups are
displayed or hidden by toggling cells TRUE or FALSE in column K. Specific sites
are identified by pull-down menu in cell J1.
Piper Plot
Refresh button in cell J2.
– Creates a list of unique group
names in column J.
– Maps cell colors in columns J and K
to series in Piper plot.
– Sizes symbols as specified in
column L.
P a g e 8 | 20
a single big group. New list of 1 group after revising groups on DATA
P a g e 9 | 20
revised show & size specifications.
P a g e 10 | 20
For example, wells AW27 and AW28
are the only sites in the Well AD-4
corridor and site selection is limited to
these two sites.
P a g e 11 | 20
Stiff diagrams and KMZ file
Stiff diagrams are created primarily for display in a KMZ file. Icon sizes are user
defined and Stiff diagrams are colored by cell colors in column J (Figure 6). X-axis
can be toggled from Cartesian to log scale to better display geochemistry of
brines.
P a g e 12 | 20
Stiff diagrams and KMZ
P a g e 13 | 20
Vertical order of cations and anions in
Stiff diagram are user defined through
pull-down menus.
P a g e 14 | 20
Default scaling of X-axis of Stiff
diagram rounds to maximum value of
milliequivalents for an ion, which is
reported in cell P15.
P a g e 15 | 20
Diagnostic Stiff diagrams in new workbook
Diagnostic Stiff diagrams also can be created in a new workbook, where each site
in a group is diagrammed in a single plot (Figure 7). A page is created for each
group of sites with an open Stiff diagram of individual ions for each site.
Milliequivalents of anions are plotted as negative values in Cartesian plots and are
inverted on log plots.
P a g e 16 | 20
Diagnostic Stiff diagrams
P a g e 17 | 20
Odd items
The following explanations address items that users have misconstrued.
1. Unused ions can be eliminated.
2. Additional ions can be specified.
mouse or
Keyboard shortcut is,
Alt-key, h, v, s
P a g e 18 | 20
Activate PIPER page.
P a g e 19 | 20
Add ions
P a g e 20 | 20