Skip to content

Commit 5cfc48c

Browse files
author
cms5347
committed
Added a file suffix variable to plots.gnuplot
1 parent fa67624 commit 5cfc48c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

plots.gnuplot

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,30 @@ set key left
77
graph_upper_bound = 50
88
graph_lower_bound = 0
99
graph_increment = 5
10+
output_type="jpeg"
1011
set macros
1112

12-
output_type="jpeg"
13+
1314
combined_str = "plot "
1415
linear_str = "plot "
1516
slope_deriv = "fp(x) = "
17+
file_suffix = "_increase.dat"
1618

1719
system("echo \"\" > slopes.dat")
1820

1921
# Build command strings
2022
do for [i = graph_lower_bound:graph_upper_bound:graph_increment] {
2123
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)
2426
echo_params = sprintf("echo \"%d %f\" >> slopes.dat", i, STATS_slope)
2527
system(echo_params)
2628

2729
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)
2931
linear_str = sprintf("%s f%d(x)", linear_str, i)
3032
} 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)
3234
linear_str = sprintf("%s f%d(x),", linear_str, i)
3335
}
3436

@@ -60,5 +62,3 @@ plot [0:55] [-.01:.05] 'slopes.dat'
6062
set term output_type
6163
set output sprintf('slopes.%s', output_type)
6264
replot
63-
64-

0 commit comments

Comments
 (0)