@@ -7,28 +7,30 @@ set key left
7
7
graph_upper_bound = 50
8
8
graph_lower_bound = 0
9
9
graph_increment = 5
10
+ output_type =" jpeg"
10
11
set macros
11
12
12
- output_type = " jpeg "
13
+
13
14
combined_str = " plot "
14
15
linear_str = " plot "
15
16
slope_deriv = " fp(x) = "
17
+ file_suffix = " _increase.dat"
16
18
17
19
system (" echo \"\" > slopes.dat" )
18
20
19
21
# Build command strings
20
22
do for [i = gra ph_low er_bound : gra ph_u pper_bound : gra ph_ incr em ent ] {
21
23
eval sprintf (" f%d(x) = m%d*x + b%d" , i, i, i)
22
- eval sprintf (" fit f%d(x) '%d_increase.dat ' via m%d,b%d" , i, i, i, i)
23
- eval sprintf (" stats '%d_increase.dat '" , i)
24
+ eval sprintf (" fit f%d(x) '%d%s ' via m%d,b%d" , i, i, file_suffix , i, i)
25
+ eval sprintf (" stats '%d%s '" , i, file_suffix )
24
26
echo_params = sprintf (" echo \" %d %f\" >> slopes.dat" , i, STATS_slope)
25
27
system (echo_params)
26
28
27
29
if (i == graph_upper_bound){
28
- combined_str = sprintf (" %s \'%d_increase.dat \' title \" remove %d nodes per trial\" , f%d(x)" , combined_str, i, i, i)
30
+ combined_str = sprintf (" %s \'%d%s \' title \" remove %d nodes per trial\" , f%d(x)" , combined_str, i, file_suffix , i, i)
29
31
linear_str = sprintf (" %s f%d(x)" , linear_str, i)
30
32
} else{
31
- combined_str = sprintf (" %s \'%d_increase.dat \' title \" remove %d nodes per trial\" , f%d(x)," , combined_str, i, i, i)
33
+ combined_str = sprintf (" %s \'%d%s \' title \" remove %d nodes per trial\" , f%d(x)," , combined_str, i, file_suffix , i, i)
32
34
linear_str = sprintf (" %s f%d(x)," , linear_str, i)
33
35
}
34
36
@@ -60,5 +62,3 @@ plot [0:55] [-.01:.05] 'slopes.dat'
60
62
set term output_type
61
63
set output sprintf (' slopes.%s' , output_type)
62
64
replot
63
-
64
-
0 commit comments