# demonstrates the use of different symbols, colours and line types in a plot.

# For reference, the 15 auto color sequence is:
#   red, blue, green, orange, cyan, magenta, brown, sky,
#   purple, gray, yellow, maroon, lawn, spring, black

 calculationMethod   1
 calculationType     custom
 xmin                5
 xmax                8
 resolution          20

  xtitle             pH
  ytitle             "concentration (mmol kgw<sup>-1</sup>)"
  2ytitle            "Saturation index"
  customXcolumn      pH   # this is used as the x-axis
  p2ymax             1
  points             Ca(HCO3)2 Al<sub>T</sub> Alk Ca   # these will be plotted as points
  lines              Ca(HCO3)2 Al<sub>T</sub> Alk Ca   # these will be plotted as lines
  lines2y            SI<sub>calcite</sub> SI<sub>fluorite</sub> SI<sub>Al(OH)3(a)</sub>
  pointType          1 2 6   # symbols to use in sequence for 'points' datasets, recycled
  pointColor         gray2 green2 red2 sky2   # colors to use in sequence for 'points'
  pointSize          3    # size of symbols, recycled
  rimColor           black green6    # explicit rim color for first 2 datasets then recycle
  rimFactor          0.08  # fractional rim width, recycled
  lineColor          black green6 red blue    # colors to use in sequence for 'lines'
  lineColor2y        purple brown6  # colors to use in sequence for 'lines2y' then auto sequence
  lineWidth2y        -0.4  # line width to use for 'lines2y', negative for dashed, recycled
  changecolor        f


# titrate acidic Al-rich water with Ca(HCO3)2

  H+ = H+
  log_k 0.

 -units mmol/kgw
  pH    5
  Al	1
  F	2
  Cl	3 charge
SAVE solution 1

USE solution 1
 Fixed_H+  -<x_axis> Ca(HCO3)2
 Al(OH)3(a) 0 0
 Fluorite   0 0
 Calcite    0 0
 CO2(g)     -3.5

  -reset FALSE

 -headings Ca(HCO3)2 pH Al<sub>T</sub> Alk Ca SI<sub>calcite</sub> SI<sub>fluorite</sub> SI<sub>Al(OH)3(a)</sub>
10 IF (STEP_NO = 1) THEN PUNCH (10-EQUI("Fixed_H+"))/TOT("water")*1e3, -la("H+"), TOT("Al")*1e3, \
        Alk*1e3, TOT("Ca")*1e3, SI("Calcite"), SI("Fluorite"), SI("Al(OH)3(a)")