From fce128aa14a9646415772dfb35728892b5b5937b Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Fri, 4 Mar 2022 14:40:13 -0800 Subject: [PATCH] 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 --- bin/feedgnuplot | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index bac9666..ffc3a66 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -1177,9 +1177,10 @@ sub plotStoredData my @nonemptyCurves = grep { $_->{datastring} } @curves; my @extraopts = map {$_->{options}} @nonemptyCurves; - my $body = join('', map { "$_," } @{$options{equation}}); - $body .= join(', ' , map({ "'-' $_" } @extraopts) ); - $body .= join('', map { ",$_" } @{$options{'equation-above'}}); + my @components = (@{$options{equation}}, + map({ "'-' $_" } @extraopts), + @{$options{'equation-above'}}); + my $body = join(',', @components); if($options{'3d'}) { print PIPE "splot $body\n"; } else { print PIPE "plot $body\n"; }