return strftime("set label 100 \"%H:%M:%S\" at screen 0.02,0.02 left tc rgb \"#000044\" font \"monospace,8\"\n", localtime())
}
+sub setranges {
+ my ($fh,$name,$min,$max) = @_;
+ if(defined $min && defined $max) {
+ plot_write($fh,"set $name [$min:$max]");
+ }
+ elsif(defined $max) {
+ plot_write($fh,"set $name [:$max]");
+ }
+ elsif(defined $min) {
+ plot_write($fh,"set $name [$min:]");
+ }
+ }
sub PlotInit {
my ($c) = @_;
plot_write($fh,"set xlabel \"".$p->{$name}->{xlabel}."\"") if $p->{$name}->{xlabel};
plot_write($fh,"set ylabel \"".$p->{$name}->{ylabel}."\"") if $p->{$name}->{ylabel};
- if(defined $p->{$name}->{ymin} && defined $p->{$name}->{ymax}) {
- plot_write($fh,"set yrange [".$p->{$name}->{ymin}.":".$p->{$name}->{ymax}."]");
- }
- elsif(defined $p->{$name}->{ymax}) {
- plot_write($fh,"set yrange [:".$p->{$name}->{ymax}."]");
- }
- elsif(defined $p->{$name}->{ymin}) {
- plot_write($fh,"set yrange [".$p->{$name}->{ymin}.":]");
- }
-
- if(defined $p->{$name}->{xmin} && defined $p->{$name}->{xmax}) {
- plot_write($fh,"set xrange [".$p->{$name}->{xmin}.":".$p->{$name}->{xmax}."]");
- }
- elsif(defined $p->{$name}->{xmax}) {
- plot_write($fh,"set xrange [:".$p->{$name}->{xmax}."]");
- }
- elsif(defined $p->{$name}->{xmin}) {
- plot_write($fh,"set xrange [".$p->{$name}->{xmin}.":]");
- }
+ setranges($fh,'xrange',$p->{$name}->{xmin},$p->{$name}->{xmax});
+ setranges($fh,'yrange',$p->{$name}->{ymin},$p->{$name}->{ymax});
+ setranges($fh,'zrange',$p->{$name}->{zmin},$p->{$name}->{zmax});
+ setranges($fh,'cbrange',$p->{$name}->{cbmin},$p->{$name}->{cbmax});
- if($p->{$name}->{addCmd} && $p->{$name}->{addCmd} ne "") {
- plot_write($fh,$p->{$name}->{addCmd});
- }
if($p->{$name}->{type} == TYPE_HISTORY) {
if($p->{$name}->{fill}) {
}
else {
plot_write($fh,"plot '-' matrix with image, '-' matrix using 1:2:(sprintf('%i', \$3)) with labels tc rgb \"#ffffff\" font ',10'");
+# plot_write($fh,"plot '-' matrix with image, '-' matrix using 1:2:(sprintf('%i', \$3)):3 with labels tc palette font ',10'");
}
}
else {
plot_write($p->{$name}->{fh},($i/$p->{$name}->{xscale})." ".$p->{$name}->{value}->[$j]->[$i]);
}
else {
- plot_write($p->{$name}->{fh},(($i-$p->{$name}->{entries})/$p->{$name}->{xscale})." ".$p->{$name}->{value}->[$j]->[$i]);
+ plot_write($p->{$name}->{fh},(($i-$p->{$name}->{entries})/($p->{$name}->{xscale}||1))." ".($p->{$name}->{value}->[$j]->[$i]||0));
}
}
plot_write($p->{$name}->{fh},"e");
}
- if($p->{$name}->{type} == TYPE_HEATMAP) {
- if($p->{$name}->{showvalues}) {
- 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");
- }
+ if($p->{$name}->{type} == TYPE_HEATMAP) {
+ if($p->{$name}->{showvalues}) {
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},"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");
}
sub PlotAdd {
my($name,$value,$curve) = @_;
$curve = 0 unless $curve;
-
push(@{$p->{$name}->{value}->[$curve]},$value||0);
shift(@{$p->{$name}->{value}->[$curve]});