Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Quick dataplot from shell pipe

0 views
Skip to first unread message

Guillaume Dargaud

unread,
Nov 19, 2009, 6:20:16 AM11/19/09
to
Hello all,
I've tried and asked that question before but without a satisfying answer
(someone even came out with an ASCII plot !).
I have a bunch of numbers coming from some shell commands, one per line. How
can I make a quick'n'dirty plot of them ?
I've played with gnuplot and could do it easily enough, but always going
through an intermediate file.

Ideally I'd like to be able to do something like that:
cut -d" " -f1 *.all | sort | uniq -c | sort -nr | sed -e "s/^ *//" | cut -d"
" -f1 | PLOT

Thanks
-
Guillaume Dargaud
http://www.gdargaud.net/


Seebs

unread,
Nov 19, 2009, 8:09:11 AM11/19/09
to
On 2009-11-19, Guillaume Dargaud <use_the_form_on...@www.gdargaud.net> wrote:
> I've played with gnuplot and could do it easily enough, but always going
> through an intermediate file.

What if the intermediate file were /dev/stdin or /dev/fd/0?

(No promises that your system has those, but if it does, they probably
work.)

-s
--
Copyright 2009, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

Laurianne Gardeux

unread,
Nov 19, 2009, 8:40:51 AM11/19/09
to
Guillaume Dargaud à écrit :

gnuplot accepts the output of commands with this syntax:

gnuplot> plot "< your_command_pipe" using ... with ...

And in a shell-script:

#!/bin/sh
gnuplot << EOF
[... put here the gnuplot-setting ...]
plot "< your_command_pipe" using ... with ...
EOF


LG


Gary Johnson

unread,
Nov 19, 2009, 2:55:04 PM11/19/09
to

I use xgraph for this. Each line of input should contain an x value and
a y value, separated by whitespace. You can plot multiple data sets by
separating each set by an empty line. When I want to plot a sequence of
values, I pipe the sequence into nl to add x-axis values.

The last version I built was 12.1 which I got from
http://www.isi.edu/nsnam/xgraph and built for Solaris.

--
Gary Johnson

0 new messages