-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.gp
More file actions
executable file
·72 lines (60 loc) · 1.81 KB
/
Copy pathplot.gp
File metadata and controls
executable file
·72 lines (60 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/gnuplot -persist
# termianl
set terminal pdf enhanced color font 'Helvetica, 20' size 21 cm, 14.8 cm dashed
# picture
set grid
set xrange [ pi/250 : 1.5*pi ]
set logscale xy
set xlabel "q"
set key box notitle right bottom spacing 1.2
set output sprintf("all.pdf")
set title "Inverse Green"
set ylabel "G^{-1}"
set yrange [ * : * ]
p8=.30
a=1.3
h=.75
list=system('ls -1B eta/N=*')
plot (2*sin(x/2))**4 lw 4 lt 2 lc rgb "red", (sqrt(8)*sin(x/sqrt(8)))**4 lw 4 lt 2 lc rgb "red", x**4*(a*p8/x)**h lw 4 lt 2 lc rgb "red" t sprintf("x**4*(%.1f*p8/x)**%.2f",a,h), for [file in list] file pt 7 ps .3 t file
# fit
set fit quiet
set fit logfile '/dev/null'
file='eta/fit'
set output sprintf("fit.pdf")
set fit errorvariables
f(x) = x**4*(a*p8/x)**h
fit2 = 0.11
fit1 = .5*fit2
fit [ fit1 : fit2 ] x**4*(a*p8/x)**h file via a, h
#print "\neta=",h
#print "a =",a,"\n"
set xrange [ pi/70 : .9 ]
set label 1 sprintf("eta\t= %.2f +/- %.2f", h, 3*h_err) at .102,.6
set label 2 sprintf("a\t= %.2f +/- %.2f", a, 3*a_err) at .102,.2
set label 3 sprintf("---|") at fit2,.0003 right
set label 4 sprintf("|---") at fit1,.0003 left
set title sprintf("Inverse Green (p8 = %.2f)", p8)
plot x**4 lw 4 lt 2 lc rgb "red", f(x) lw 4 lt 2 lc rgb "red" t sprintf("x**4*(a*p8/x)**eta"), file pt 7 ps .3 t file
fit1=0.075
fit2=0.25
m=1000
step=(fit2-fit1)/m
fitcmd(i) = sprintf("fit [ .7*(fit1+step*%d) : fit1+step*%d ] x**4*(a*p8/x)**h file via a, h", i, i)
s=0
do for [i=0:m] {
eval(fitcmd(i))
eval("print (fit1+step*i), h")
eval("s = s+h")
}
# plot
set terminal pdf enhanced color font 'Helvetica, 20' size 21 cm, 14.8 cm dashed
set output sprintf("fita.pdf")
set title "effective eta"
set ylabel "eta"
set xrange [ * : * ]
unset logscale xy
set key box notitle right top spacing 1.2
unset label 1
file='fita.dat'
plot file w l lw 4 t file
# EOF