]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/Plot.pm
disabled quality score conversion in FASTQ and Solexa
[biopieces.git] / code_perl / Maasha / Plot.pm
index 720b5e92a561dda5d9ba374c15012865ed2f6e4c..4981b627d774a58e7ef209c05e2aea4c0583a58f 100644 (file)
@@ -66,7 +66,7 @@ sub lineplot_simple
 
     # 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' };
 
@@ -93,11 +93,12 @@ sub lineplot_simple
     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";
@@ -158,7 +159,6 @@ sub histogram_simple
     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++ )