Plotting with no STDIN data works

This command now works:

  echo "" | ./bin/feedgnuplot --equation 'x' --image /tmp/1.jpg

Prior to the patch, there's a trailing , in the command
This commit is contained in:
Dima Kogan 2022-03-04 14:40:13 -08:00
parent 8c0f3df285
commit fce128aa14

View File

@ -1177,9 +1177,10 @@ sub plotStoredData
my @nonemptyCurves = grep { $_->{datastring} } @curves; my @nonemptyCurves = grep { $_->{datastring} } @curves;
my @extraopts = map {$_->{options}} @nonemptyCurves; my @extraopts = map {$_->{options}} @nonemptyCurves;
my $body = join('', map { "$_," } @{$options{equation}}); my @components = (@{$options{equation}},
$body .= join(', ' , map({ "'-' $_" } @extraopts) ); map({ "'-' $_" } @extraopts),
$body .= join('', map { ",$_" } @{$options{'equation-above'}}); @{$options{'equation-above'}});
my $body = join(',', @components);
if($options{'3d'}) { print PIPE "splot $body\n"; } if($options{'3d'}) { print PIPE "splot $body\n"; }
else { print PIPE "plot $body\n"; } else { print PIPE "plot $body\n"; }