# Set variables which set gnu plot properties
@colors_errbars = ("#f08080", "#80f080", "#8080f0");
@colors_points = ("#ff0000", "#00ff00", "#0000ff");
@plt_errbars = (
\'title "button0" with errorbars lw 0.15 pt 1 ps 0.2 lc rgbcolor\',
\'title "button1" with errorbars lw 0.15 pt 1 ps 0.2 lc rgbcolor\',
\'title "button2" with errorbars lw 0.15 pt 1 ps 0.2 lc rgbcolor\'
);
$plt_points = \'notitle with points ps 0.2 lc rgbcolor\';
$plt_lines = \'notitle with lines lw 0.1 lc rgbcolor\';
sub generate_plot
{
my $plth = shift;
my $nfile_size = -s $outfile_name[3];
print $plth \'set xlabel "time [s]" 0,0.5\' . "\\n";
print $plth \'set yrange [0:120]\' . "\\n";
print $plth \'unset xrange\' . "\\n";
print $plth \'set xrange [0:30]\' . "\\n";
print $plth \'set autoscale x\' . "\\n";
print $plth \'set autoscale y\' . "\\n";
print $plth \'set bars 0\' . "\\n";
print $plth \'set terminal png size 1680,1050\' . "\\n";
print $plth "set output \\"$outfile_name[7]\\"" . "\\n";
print $plth "set size 1,0.5\\n";
if ($nfile_size)
{
print $plth "set multiplot layout 3,2 title \\"$graph_name\\"" . "\\n";
}
else
{
print $plth "set multiplot layout 3,1 title \\"$graph_name\\"" . "\\n";
}
$max_basic_value += 10; #sets yrange value
for($i=0; $i<3; $i++)
{
#set only top level title
if ($i == 0)
{
print $plth "set title \'$tcase_settings_cap[$outfile-1]\' \\n";
}
else
{
print $plth "unset title \\n";
}
print $plth "set yrange [0:$max_basic_value]" . "\\n";
#align plots
print $plth \'set lmargin at screen 0.08\' . "\\n";
print $plth \'set ylabel "basic value" -0.5,0\' . "\\n";
print $plth "plot ";
print $plth "\\"$outfile_name[$i]\\" $plt_errbars[$i] \\"$colors_errbars[$i]\\"";
print $plth ",";
print $plth "\\"$outfile_name[$i]\\" $plt_lines \\"$colors_points[$i]\\"";
print $plth \' \' . "\\n";
#only if second data are available
if ($nfile_size)
{
# Set only top level title
if ($i == 0)
{
print $plth "set title \'$tcase_settings_second[$outfile-1]\' \\n"; #name for second column
}
else
{
print $plth "unset title \\n";
}
print $plth \'set yrange [0:16]\' . "\\n";
print $plth \'set lmargin at screen 0.55\' . "\\n";
print $plth \'set ylabel "advanced value" -0.5,0\' . "\\n";
print $plth "plot ";
print $plth "\\"$outfile_name[$i+3]\\" $plt_errbars[$i] \\"$colors_errbars[$i]\\"";
print $plth ",";
print $plth "\\"$outfile_name[$i+3]\\" $plt_lines \\"$colors_points[$i]\\"";
print $plth \' \' . "\\n";
}
}
print $plth "unset multiplot\\n";
}