Problem: every now and then i want to make a quick plot with numbers extracted with awk or something similar. gnuplot is great, but sucks for non-interactive use. perldl is easily scripted, but overkill for this. my specific need was to make quick-n-dirty histograms of a column of numbers.
Solution: the gsl package has a 'gsl-histogram' task while the plotutils package has 'graph'. this combination was exactly what i was looking for. here's an example one-liner:
cat *.output | awk '{print $9}' | gsl-histogram 0 2.5 25 | awk '{print $1, $3 ; print $2, $3}' | graph -T X
this plots up a histogram with 25 bins between 0 and 2.5 using the X-windows driver. refer to the plotutils documentation for other driver types and output options.
Friday, October 24, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment