gnuplot driver can parse scientific notation

Ignore-this: 9c3fa6a5d1974f806ff6cd587c3af5b5

darcs-hash:20090806185938-0cb85-0d54fd39632f145019e923dc9123bc297bbf37fd.gz
This commit is contained in:
Dima Kogan 2009-08-06 11:59:38 -07:00
parent a8bb73ec90
commit 37667ddec3

View File

@ -149,11 +149,14 @@ sub main {
my $streamIdx = 0; my $streamIdx = 0;
select((select(STDOUT), $| = 1)[0]); select((select(STDOUT), $| = 1)[0]);
my $xlast = 0; my $xlast = 0;
# regexp for a possibly floating point, possibly scientific notation number
my $numRE = qr/([-]?[0-9\.]+(?:e[-]?[0-9]+)?)/;
while(<>) while(<>)
{ {
chomp; chomp;
my $line = $_; my $line = $_;
foreach my $point ($line =~ /([-]?[0-9\.]+)/g) { foreach my $point ($line =~ /$numRE/g) {
my $buf = $buffers[$streamIdx]; my $buf = $buffers[$streamIdx];
# data buffering (up to stream sample size) # data buffering (up to stream sample size)