4 ms·
No need for any of that; gnuplot can just read from the pipe directly: `seq 1 10 | gnuplot -e "plot '<&2'"`
by db48x 4y ago
No need for any of that; gnuplot can just read from the pipe directly: `seq 1 10 | gnuplot -e "plot '<&2'"`
- cb321 4y agoNice! Added in 2008, if anyone is curious. (EDIT: and in db48x's comment already[1]) Also, I had to put in a `cat` to make it work: seq 1 10 | gnuplot -e "plot '<cat' with lines" [1] https://news.ycombinator.com/item?id=34365290 https://news.ycombinator.com/item?id=34365290
- db48x 4y agoOh, that goes to show you how little I use it. I read the documentation and merely assumed that it would work for stdin, but gnuplot exits with an error in that case. This will work, but it’s pretty funky: gnuplot -e "set terminal sixelgd;plot '<&3' with lines" 3< <(seq 1 10) Good luck remembering that!
- enriquto 4y agoNo need of cat. You can use filename "-" to mean standard input: seq 1 10 | gnuplot -e 'plot "-"'