gnuplot 5 no longer supports using old-style ($1, $2 etc.) gnuplot 4 parameter
substituion causing fio2gnuplot to break on newer Linux distributions.
Fix this by using new-style arg variables everywhere and conditionally convert
old-style substituions to new-style variables. Add some casting to the average
variable so it is treated as a number or string appropriately and bail out with
an error message when too few parameters are passed in.
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
# This Gnuplot file has been generated by eNovance
# This Gnuplot file has been generated by eNovance
+needed_args = 8
+if (exists("ARGC") && ARGC >= needed_args) \
+ found_args = 1; \
+else if (strlen("$$#") < 3 && "$#" >= needed_args) \
+ found_args = 1; \
+ ARG1 = "$0"; \
+ ARG2 = "$1"; \
+ ARG3 = "$2"; \
+ ARG4 = "$3"; \
+ ARG5 = "$4"; \
+ ARG6 = "$5"; \
+ ARG7 = "$6"; \
+ ARG8 = "$7"; \
+else \
+ found_args = 0; \
+ print "Aborting: could not find all arguments"; \
+ exit
+
+avg_num = ARG8 + 0
+avg_str = sprintf("%g", avg_num)
+
+set title ARG1
set terminal png size 1280,1024
set terminal png size 1280,1024
+set output ARG4 . '.png'
#set terminal x11
#Preparing Axes
#set terminal x11
#Preparing Axes
#set data style lines
set key top left reverse
set xlabel "Time (Seconds)"
#set data style lines
set key top left reverse
set xlabel "Time (Seconds)"
set xrange [0:]
set yrange [0:]
set xrange [0:]
set yrange [0:]
set style line 100 lt 7 lw 0.5
set style line 1 lt 1 lw 3 pt 3 linecolor rgb "green"
set style line 100 lt 7 lw 0.5
set style line 1 lt 1 lw 3 pt 3 linecolor rgb "green"
-plot '$1' using 2:3 with linespoints title '$2', $7 w l ls 1 ti 'Global average value ($7)'
+plot ARG2 using 2:3 with linespoints title ARG3, avg_num w l ls 1 ti 'Global average value (' . avg_str . ')'
-set output '$5.png'
-plot '$1' using 2:3 smooth csplines title '$2', $7 w l ls 1 ti 'Global average value ($7)'
+set output ARG6 . '.png'
+plot ARG2 using 2:3 smooth csplines title ARG3, avg_num w l ls 1 ti 'Global average value (' . avg_str . ')'
-set output '$6.png'
-plot '$1' using 2:3 smooth bezier title '$2', $7 w l ls 1 ti 'Global average value ($7)'
+set output ARG7 . '.png'
+plot ARG2 using 2:3 smooth bezier title ARG3, avg_num w l ls 1 ti 'Global average value (' . avg_str .')'
# This Gnuplot file has been generated by eNovance
# This Gnuplot file has been generated by eNovance
+needed_args = 5
+if (exists("ARGC") && ARGC >= needed_args) \
+ found_args = 1; \
+else if (strlen("$$#") < 3 && "$#" >= needed_args) \
+ found_args = 1; \
+ ARG1 = "$0"; \
+ ARG2 = "$1"; \
+ ARG3 = "$2"; \
+ ARG4 = "$3"; \
+ ARG5 = "$4"; \
+else \
+ found_args = 0; \
+ print "Aborting: could not find all arguments"; \
+ exit
+
+set title ARG1
set terminal png size 1280,1024
set terminal png size 1280,1024
+set output ARG4 . '.png'
#set terminal x11
#3D Config
set isosamples 30
#set terminal x11
#3D Config
set isosamples 30
set key top left reverse
set ylabel "Disk"
set xlabel "Time (Seconds)"
set key top left reverse
set ylabel "Disk"
set xlabel "Time (Seconds)"
set cbrange [0:]
set zrange [0:]
set cbrange [0:]
set zrange [0:]
set size 0.5,0.5
set view 64,216
set origin 0,0.5
set size 0.5,0.5
set view 64,216
set origin 0,0.5
-splot '$1' using 2:1:3 with linespoints title '$2'
+splot ARG2 using 2:1:3 with linespoints title ARG3
#Top Right View
set size 0.5,0.5
#Top Right View
set size 0.5,0.5
set view 90,0
set pm3d at s solid hidden3d 100 scansbackward
set pm3d depthorder
set view 90,0
set pm3d at s solid hidden3d 100 scansbackward
set pm3d depthorder
-splot '$1' using 2:1:3 with linespoints title '$2'
+splot ARG2 using 2:1:3 with linespoints title ARG3
#Bottom Right View
set size 0.5,0.5
#Bottom Right View
set size 0.5,0.5
set view 63,161
set pm3d at s solid hidden3d 100 scansbackward
set pm3d depthorder
set view 63,161
set pm3d at s solid hidden3d 100 scansbackward
set pm3d depthorder
-splot '$1' using 2:1:3 with linespoints title '$2'
+splot ARG2 using 2:1:3 with linespoints title ARG3
#Bottom Left View
set size 0.5,0.5
set origin 0,0
set pm3d map
#Bottom Left View
set size 0.5,0.5
set origin 0,0
set pm3d map
-splot '$1' using 2:1:3 with linespoints title '$2'
+splot ARG2 using 2:1:3 with linespoints title ARG3
#Unsetting multiplotting
unset multiplot
#Unsetting multiplotting
unset multiplot
#Preparing 3D Interactive view
set mouse
set terminal png size 1024,768
#Preparing 3D Interactive view
set mouse
set terminal png size 1024,768
+set output ARG4 . '-3D.png'
#set term x11
set view 64,216
#set term x11
set view 64,216
set size 1,1
set pm3d at bs solid hidden3d 100 scansbackward
set pm3d depthorder
set size 1,1
set pm3d at bs solid hidden3d 100 scansbackward
set pm3d depthorder
-splot '$1' using 2:1:3 with linespoints title '$2'
+splot ARG2 using 2:1:3 with linespoints title ARG3
# This Gnuplot file has been generated by eNovance
# This Gnuplot file has been generated by eNovance
+if (exists("ARGC") && ARGC > 5) \
+ found_args = 1; \
+else if (strlen("$$#") < 3 && "$#" > 5) \
+ found_args = 1; \
+ ARG1 = "$0"; \
+ ARG2 = "$1"; \
+ ARG3 = "$2"; \
+ ARG4 = "$3"; \
+ ARG5 = "$4"; \
+ ARG6 = "$5"; \
+else \
+ found_args = 0; \
+ print "Aborting: could not find all arguments"; \
+ exit
+avg_num = ARG6 + 0
+avg_str = sprintf("%g", avg_num)
+
+set title ARG1
set terminal png size 1280,1024
set terminal png size 1280,1024
+set output ARG4 . '.png'
set palette rgbformulae 7,5,15
set style line 100 lt 7 lw 0.5
set style fill transparent solid 0.9 noborder
set auto x
set palette rgbformulae 7,5,15
set style line 100 lt 7 lw 0.5
set style fill transparent solid 0.9 noborder
set auto x
set xlabel "Disk"
set yrange [0:]
set style data histogram
set xlabel "Disk"
set yrange [0:]
set style data histogram
set xtic rotate by 45 scale 0 font ",8" autojustify
set xtics offset 0,-1 border -5,1,5
set style line 1 lt 1 lw 3 pt 3 linecolor rgb "green"
set xtic rotate by 45 scale 0 font ",8" autojustify
set xtics offset 0,-1 border -5,1,5
set style line 1 lt 1 lw 3 pt 3 linecolor rgb "green"
-plot '$1' using 2:xtic(1) ti col, $5 w l ls 1 ti 'Global average value ($5)'
+plot ARG2 using 2:xtic(1) ti col, avg_num w l ls 1 ti 'Global average value (' . avg_str . ')'