From fa51aa5e10bacb5ea80c9e5dee5d19c8946be625 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Wed, 23 Apr 2014 14:28:37 +0200 Subject: [PATCH] corrected labels, added values to diamond plot --- hmon/HPlot.pm | 34 ++++++++++++++++++++++++++-------- hmon/hmon_diamond.pl | 15 ++++++++------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/hmon/HPlot.pm b/hmon/HPlot.pm index 5ccd65a..fe72bbd 100755 --- a/hmon/HPlot.pm +++ b/hmon/HPlot.pm @@ -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"); + } diff --git a/hmon/hmon_diamond.pl b/hmon/hmon_diamond.pl index e102fbf..0e93d97 100755 --- a/hmon/hmon_diamond.pl +++ b/hmon/hmon_diamond.pl @@ -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'); -- 2.43.0