plotpipe: 3 columns = x,y,color. Color must be numeric.
This commit is contained in:
parent
9d500db854
commit
cbaa61fd78
|
@ -1,8 +1,5 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/perl
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
: <<=cut
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
@ -63,4 +60,16 @@ B<gnuplot>
|
|||
|
||||
=cut
|
||||
|
||||
gnuplot -p -e 'plot "/dev/stdin"'
|
||||
$line1 = <>;
|
||||
@col = split /\s+/, $line1;
|
||||
if($#col == 1) {
|
||||
# 2 col
|
||||
open GNUPLOT,"|-", q(gnuplot -p -e 'plot "/dev/stdin"') or die;
|
||||
} elsif($#col == 2) {
|
||||
# 3 col (3rd = color)
|
||||
open GNUPLOT,"|-", q(gnuplot -p -e 'plot "/dev/stdin" using 1:2:3 with points palette') or die;
|
||||
} else {
|
||||
die "$#col,@col,$line1";
|
||||
}
|
||||
print GNUPLOT $line1, <>;
|
||||
close GNUPLOT;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
: <<=cut
|
||||
=encoding utf8
|
||||
|
|
Loading…
Reference in a new issue