--histo with a --timefmt makes time-based histograms

Not documented yet or added to the tests yet, but appears to work
This commit is contained in:
Dima Kogan 2021-07-22 11:23:48 -07:00
parent 1e7286cb5d
commit 35115083ce

View File

@ -841,10 +841,16 @@ sub mainThread
addOption($_, 'extraoptions', 'axes x2y2 ') foreach (@{$options{x2y2}}); addOption($_, 'extraoptions', 'axes x2y2 ') foreach (@{$options{x2y2}});
# timefmt # timefmt
my $histcol;
if( $options{timefmt} ) if( $options{timefmt} )
{ {
print(PIPE "set timefmt '$options{timefmt}'\n"); print(PIPE "set timefmt '$options{timefmt}'\n");
print(PIPE "set xdata time\n"); print(PIPE "set xdata time\n");
$histcol = qq{timecolumn(2,"$options{timefmt}")};
}
else
{
$histcol = '$2';
} }
# set up histograms # set up histograms
@ -859,7 +865,7 @@ sub mainThread
# domain, so I get the statistics of the 2nd column: $2 # domain, so I get the statistics of the 2nd column: $2
addOption($id, addOption($id,
'usingoptions', 'usingoptions',
'using (histbin($2)):(1.0) smooth ' . $options{histstyle}, 'using (histbin(' . $histcol . ')):(1.0) smooth ' . $options{histstyle},
'do-not-override'); 'do-not-override');
} }