# Gnuplot script for plotting Ti-Zr-Y diagram
# (after Pearce and Cann, 1973)
# 24-01-2002 by IWW
set term postscript enhanced "Roman" 11
set output "tizry-ternary.ps"
#%%BoundingBox: 250 67 538 400
#set size square
set size square 0.535,0.65
set angle degrees
set noborder
set xrange [-10:100]
set yrange [-10:100]
set noxtics
set noytics
set key 100,90
#---- Ternary plot
# ------------
# old implementation without normalization (by M. Karunaratne &
# Dr. E. Buxbaum)
#gx(x,y) = x + y * cos(60)
#gy(x,y) = y * cos(30)
#---- new implementation with automatic normalization (by IWW)
gx(a,b,c) = 100*(a/(a+b+c) + b*cos(60)/(a+b+c))
gy(a,b,c) = 100*b*cos(30)/(a+b+c)
set label 41 "Zr" at -5,-5 center font "Times,13"
set label 42 "Ti/100" at 50,91.5 center font "Times,13"
set label 43 "Y{\264}3" at 105,-5 center font "Times,13"
set label 44 "A" at 55,35 center font "Times,13"
set label 45 "B" at 49.5,27 center font "Times,13"
set label 46 "C" at 40,17 center font "Times,13"
set label 47 "D" at 39,34 center font "Times,13"
set label 48 "A = Volcanic arc basalts" at -5,92 left font "Arial,11.5"
set label 49 "B = MORB + VAB" at -5,87 left font "Arial,11.5"
set label 50 "C = Volcanic arc basalts" at -5,82 left font "Arial,11.5"
set label 51 "D = Within-plate basalts" at -5,77 left font "Arial,11.5"
plot 'Ternary.bnd' index 0 using (gx($1,$2,$3)):(gy($1,$2,$3)) notitle with lines 1, \
'TiZrY-diagram.cls' using (gx($3,$1,$2)):(gy($3,$1,$2)) notitle with lines 1
reset