Skip to content

Instantly share code, notes, and snippets.

@huned
Created February 11, 2015 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huned/25acca1dd567aed6f2c5 to your computer and use it in GitHub Desktop.
Save huned/25acca1dd567aed6f2c5 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Plot an ASCII histogram of numbers from stdin. Uses gnuplot.
# Optionally specify bin size as an argument.
if [ "$1" == '' ]; then
binsize=100
else
binsize=$1
fi
gnuplot -e "set term dumb; set key off; set yzeroaxis; plot '-' using (floor(\$1/$binsize)):(1) smooth frequency with boxes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment