# $CVSHeader: pal8e/dat/stat/plot-Qdist,v 1.2 2005/02/15 01:10:24 indraneel Rel $

## Run using GNUPlot

set data style lines
set mxtics 5
show mxtics
set mytics 10
show mytics
#set key below box

#a == amplitude
#s == standard deviation
#c == center

fs(x) = as * exp (-0.5 * (((x-cs)/ss)**2))

fa1(x) = aa1 * exp (-0.5 * (((x-ca1)/sa)**2))
fa2(x) = aa2 * exp (-0.5 * (((x-ca2)/sa)**2))
fa(x) = fa1(x) + fa2(x)

as = 0.170
cs = 4.810
ss = 0.227

aa1 = 0.073
aa2 = 0.077
ca1 = 4.463
ca2 = 5.245
sa = 0.261

fit [3.2:7.2] fs(x) "QdistSyn" using 1:2 via as, ss, cs
fit [3.2:7.2] fa(x) "QdistAnti" using 1:2 via aa1, aa2, ca1, ca2, sa

set xrange [3.2:7]
set yrange [0:0.2]
set xlabel "C{/Symbol a}-C{/Symbol a} Bonded Pair Distance (@^{/Symbol \260}A)"
set ylabel "Normalised Count"
set title "C{/Symbol a}-C{/Symbol a} Pair Distance (Quadruplet Parameter 1) for Bonded Strands from DSSP"

set arrow from 4.81,graph 0 to 4.81,graph 1 nohead lt 1 lw 4
set label "c1" at 4.7,graph 0.96
set arrow from 4.46,graph 0 to 4.46,graph 1 nohead lt 1 lw 4
set label "c2" at 4.3,graph 0.96
set arrow from 5.24,graph 0 to 5.24,graph 1 nohead lt 1 lw 4
set label "c3" at 5.1,graph 0.96

set terminal x11
plot "QdistSyn" with points title "Parallel strands" pt 2, \
    	fs(x) lt 2 lw 4 title "Normal Fit (parallel)", \
	"QdistAnti" with points title "Antiparallel strands" pt 3, \
	fa(x) lt 3 lw 4 title "Normal Fit (antiparallel)"

#set terminal postscript enhanced color blacktext solid "Times-Roman" 12
set terminal postscript eps enhanced "Times-Roman" 18
set output "Qdist.eps"
replot


