Created
January 21, 2020 08:28
-
-
Save cerisara/9be8e18e6a11af62b69da99852de0473 to your computer and use it in GitHub Desktop.
Easy-to-use script to plot histograms from a text file with gnuplot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
d=0.5 | |
if [ $# -ge 2 ]; then | |
echo "2parms $1 $2" | |
d=$2 | |
fi | |
rm -f /tmp/pp.gp | |
touch /tmp/pp.gp | |
echo 'set terminal x11 persist'>>/tmp/pp.gp | |
echo 'binwidth='$d>>/tmp/pp.gp | |
echo 'set boxwidth binwidth'>>/tmp/pp.gp | |
echo 'bin(x,width)=width*floor(x/width)+ binwidth/2.0'>>/tmp/pp.gp | |
echo 'plot "'$1'" using (bin($1,binwidth)):(1.0) smooth freq with boxes fs solid 0.25 notitle'>>/tmp/pp.gp | |
gnuplot /tmp/pp.gp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment