# Returns list.
- my ( $tmp_file, $pid, $fh_in, $fh_out, $cmd, $i, $line, @lines, $xtic_space, @plot_cmd );
+ my ( $tmp_file, $pid, $fh_in, $fh_out, $cmd, $i, $line, @lines, $xtic_space, @plot_cmd, $title );
$tmp_dir ||= $ENV{ 'BP_TMP' };
print $fh_in "set logscale y\n" if $options->{ "logscale_y" };
print $fh_in "set grid\n" if not $options->{ "terminal" } eq "dumb";
print $fh_in "set autoscale\n";
- print $fh_in "unset key\n";
print $fh_in "set xtics border in scale 0 nomirror rotate by 90 offset character 0, 0, 0\n";
- for ( $i = 1; $i < scalar @{ $data->[ 0 ] } + 1; $i++ ) {
- push @plot_cmd, qq("$tmp_file" using $i with lines ls 1);
+ for ( $i = 1; $i < scalar @{ $data->[ 0 ] } + 1; $i++ )
+ {
+ $title = $options->{ 'keys' }->[ $i - 1 ] || $options->{ 'list' };
+ push @plot_cmd, qq("$tmp_file" using $i with lines title "$title");
}
print $fh_in "plot " . join( ", ", @plot_cmd ) . "\n";
print $fh_in "set style histogram title offset character 0, 0, 0\n";
print $fh_in "set style data histograms\n";
print $fh_in "set xtics border in scale 0 nomirror rotate by 90 offset character 0, 0, 0\n";
-
print $fh_in "plot '-' using 2:xticlabels(1)\n";
for ( $i = 0; $i < @{ $data }; $i++ )