]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
corrected labels, added values to diamond plot
authorJan Michel <j.michel@gsi.de>
Wed, 23 Apr 2014 12:28:37 +0000 (14:28 +0200)
committerJan Michel <j.michel@gsi.de>
Wed, 23 Apr 2014 12:28:37 +0000 (14:28 +0200)
hmon/HPlot.pm
hmon/hmon_diamond.pl

index 5ccd65a5bb40e7860c4cac0996eeb2cdee752634..fe72bbde200899f4b91ee54c805f5c4b9de35b89 100755 (executable)
@@ -57,6 +57,7 @@ sub PlotInit {
   $p->{$name}->{type}   or die "No plot type specified";
   $p->{$name}->{output} or die "No destination specified";
   $p->{$name}->{colors} = $p->{$name}->{colors} || \@color;
+  $p->{$name}->{showvalues} = $p->{$name}->{showvalues} || 0;
 
   foreach my $i (0..($c->{entries}-1)) {
     for my $j (0..($c->{curves}-1)) {
@@ -154,7 +155,13 @@ sub PlotInit {
     }
   elsif($p->{$name}->{type} == TYPE_HEATMAP) {
     plot_write($fh,"set view map");
-    plot_write($fh,"splot '-' matrix with image");
+    plot_write($fh,"set palette rgbformulae 22,13,-31");
+    if ($p->{$name}->{showvalues} == 0) {
+      plot_write($fh,"splot '-' matrix with image");
+      }
+    else {
+      plot_write($fh,"plot '-' matrix with image, '-' matrix using 1:2:(sprintf('%i', \$3)) with labels tc rgb \"#ffffff\" font ',16'");
+      }
     }
   else {
     die "Plot type not supported";
@@ -200,14 +207,25 @@ sub PlotDraw {
       
       
   if($p->{$name}->{type} == TYPE_HEATMAP) {    
-    for(my $j=0; $j<$p->{$name}->{curves}; $j++) {
-      for(my $i=0; $i< $p->{$name}->{entries}; $i++) {
-        plot_write($p->{$name}->{fh},($p->{$name}->{value}->[$j]->[$i]||0)." ",1);
+#     for(my $s=0; $s<=$p->{$name}->{showvalues}; $s++) {
+      for(my $j=0; $j<$p->{$name}->{curves}; $j++) {
+        for(my $i=0; $i< $p->{$name}->{entries}; $i++) {
+          plot_write($p->{$name}->{fh},($p->{$name}->{value}->[$j]->[$i]||0)." ",1);
+          }
+        plot_write($p->{$name}->{fh}," ",0);
         }
-      plot_write($p->{$name}->{fh}," ",0);
-      }
-    plot_write($p->{$name}->{fh},"e");      
-    plot_write($p->{$name}->{fh},"e");      
+      plot_write($p->{$name}->{fh},"e");      
+      plot_write($p->{$name}->{fh},"e");     
+#       }
+      for(my $j=0; $j<$p->{$name}->{curves}; $j++) {
+        for(my $i=0; $i< $p->{$name}->{entries}; $i++) {
+          plot_write($p->{$name}->{fh},($p->{$name}->{value}->[$j]->[$i]||0)." ",1);
+          }
+        plot_write($p->{$name}->{fh}," ",0);
+        }
+      plot_write($p->{$name}->{fh},"e");      
+      plot_write($p->{$name}->{fh},"e");     
+
     }
     
     
index e102fbfdd6a10db08cc59380460168660f1a8fe4..0e93d973da7e67a952c983dcdf2a0120192295c4 100755 (executable)
@@ -16,8 +16,8 @@ my $plot2 = ();
 $plot2->{name}    = "DiamondRate";
 $plot2->{file}    = "files/DiamondRate";
 $plot2->{curves}  = 1;
-$plot2->{entries} = 6;
-$plot2->{curves}  = 6;
+$plot2->{entries} = 7;
+$plot2->{curves}  = 7;
 $plot2->{type}    = HPlot::TYPE_HEATMAP;
 $plot2->{output}  = HPlot::OUT_PNG;
 $plot2->{zlabel}  = "Hitrate";
@@ -25,10 +25,11 @@ $plot2->{sizex}   = 580;
 $plot2->{sizey}   = 465;
 $plot2->{nokey}   = 1;
 $plot2->{buffer}  = 1;
-$plot2->{xmin}    = -0.5;
-$plot2->{xmax}    = 5.5;
-$plot2->{ymin}    = -0.5;
-$plot2->{ymax}    = 5.5;
+$plot2->{xmin}    = 0.5;
+$plot2->{xmax}    = 6.5;
+$plot2->{ymin}    = 6.5;
+$plot2->{ymax}    = 0.5;
+$plot2->{showvalues} = 1;
 
 HPlot::PlotInit($plot2);
 
@@ -125,7 +126,7 @@ while (1) {
 
     for my $x (0..5) {
       for my $y (0..5) {
-        HPlot::PlotFill('DiamondRate',$diff->{$fpga->[$y]->[$x]+0x5000}->[$chan->[$y]->[$x]],5-$y,$x);
+        HPlot::PlotFill('DiamondRate',$diff->{$fpga->[$y]->[$x]+0x5000}->[$chan->[$y]->[$x]],6-$y,6-$x);
         }
       }
     HPlot::PlotDraw('DiamondRate');