So zeichnen Sie die Spalte in Unix in einer Zeile

701
user196711

Ich möchte eine Spalte mit Daten, die von einem Skript in Unix ausgegeben wird, in nur einer Zeile darstellen. Zum Beispiel so etwas

script | cut -f2 -d ',' | gnuplot .... 
4

1 Antwort auf die Frage

0
Joce

You have to give gnuplot a plotting instruction in the command line, and can use the data piping special file '-'.

E.g.,

echo "1\n2\n4\n8\n16" | gnuplot -e "plot '-' u 0:1 w linespoints" -persist 

The -persist option allows to keep the window open. If you want to produce a PDF rather, you can use:

echo "1\n2\n4\n8\n16" | gnuplot -e "set term pdf; set output 'plot.pdf'; plot '-' u 0:1 w linespoints"