Note: Some of the examples need an input stream of (approximately) normally distributed random numbers. Here is an example of how you might create a script able to generate such a stream:
cat << EOF > ./normalDist.sh #!/bin/sh awk 'function gaussian() { tot=0; num=20;for(i=0; i<num; ++i) { tot+=(2.*rand()-1)}; return tot*sqrt(3./num) } BEGIN{while (1==1) {print gaussian()}}' EOF chmod +x ./normalDist.sh
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print $1} else {print 5+$1}} else { last =$1 } }' | \ head -50000 | \ hist png out.png n 100 l -5 u 10 title 'Two Gaussians' |
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print "sig",$1} else {print "bg",5+$1}} else { last =$1 } }' | \ head -50000 | \ hist png out.png n 100 l -5 u 10 title 'Two Gaussians - overlaid' multi |
![]() |
echo a 0 big 1 cat 2 did 3 eat 4 four 5 goats 6 hovering 7 in 8 just 9 killed 10 lice 11 | \ hist multi n 24 l 0 u 12 png out.png title 'Legend example' ly 0 uy 3 |
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print $1} else {print 5+$1}} else { last =$1 } }' | \ head -50000 | \ hist2D png out.png n 100 l -5 u 10 overwrite title 'Overwrite example' |
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print $1} else {print 5+$1}} else { last =$1 } }' | \ head -50000 | \ hist2D png out.png n 100 l -5 u 10 colourscale rainbow title 'Rainbow palette example' |
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print $1} else {print 5+$1}} else { last =$1 } }' | \ head -50000 | \ hist2D png out.png n 100 l -5 u 10 allanach fillvoid colourscale title 'Allanach palette example' |
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print $1} else {print 5+$1}} else { last =$1 } }' | \ head -50000 | \ hist2D png out.png n 100 l -5 u 10 allanach nofillvoid colourscale title "'nofillvoid' example" |
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print $1} else {print 5+$1}} else { last =$1 } }' | \ head -50000 | \ hist2D profile xy png out.png l -5 u 10 allanach nofillvoid colourscale title "xy profile example" |
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print $1} else {print 5+$1}} else { last =$1 } }' | \ head -50000 | \ hist2D png out.png n 100 l -5 u 10 greyscale colourscale title 'greyscale palette example' |
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print $1} else {print 5+$1}} else { last =$1 } }' | \ head -150000 | \ hist2D png out.png n 100 l -5 u 10 colourscale userpal 0.1 1 1 1 userpal 0.15 0 0 1 userpal 0.2 0 1 0 userpal 0.25 0 0 1 userpal 0.3 1 1 0 title 'userpalette example' |
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print $1} else {print 5+$1}} else { last =$1 } }' | \ head -150000 | \ hist2D png out.png n 100 l -5 u 10 colourscale noautoscalezcolours userpal 0 1 1 0 userpal 100 1 0 0 lz 0 uz 100 title 'Absolute z colour scale example' & |
![]() |
./normalDist.sh | \ awk 'BEGIN{for(i=0;i<1000;++i){print i,i}}' | \ hist2DWeighted nx 10 ny 1 rainbow l 0 u 1000 png out.png title 'weighted 2D histogram example' |
![]() |
echo 0.5 0.5 1 | \ hist2DWeighted xname 'x axis' yname 'y axis' png out.png title 'Axis labels example' l 0 u 1 |
![]() |
echo 0.5 0.5 1 | \ hist2DWeighted xname 'x axis' yname 'y axis' png out.png title 'y-axis label running down, top jusitified' rightjustify ynamedirection DOWN l 0 u 1 y; display out.png |
![]() |
./normalDist.sh | \ awk '{if (NR%2==1) {if(last<1) {print $1} else {print 5+$1}} else { last =$1 } }' | \ head -50000 | \ hist2D png out.png n 100 l -5 u 10 rainbow colourscale logz title 'LogZ rainbow palette example' & |
![]() |
awk 'BEGIN{for (i=0;i<100000;++i){x=rand()*2-1; print x,x*x}}' | \ histWeighted title Parabola png out.png |
![]() |
./normalDist.sh 0 1 | \ head -30000 | \ awk '{if (rand()<0.3333333) {print "s" } else {print "b"} ; print}' | \ hist multi ratio s b ly 0 uy 1.5 title 'Ratio of two Gaussian histograms' xname x yname 'bin-by-bin ratio' n 100 png out.png |
![]() |
awk 'BEGIN{ while(1==1) { a=rand(); b=rand(); print a,a*b} }' | \ head -300000 | \ hist2D profile y nx 12 lx -0.1 ux 1.1 ny 2 ly 0 uy 1 title 'exampe of profile hisogram mode' png out.png |
![]() |
awk 'BEGIN{ while(1==1) { a=rand(); b=rand(); print a*a,a*a*b} }' | \ head -300000 | \ hist2D profile y fadeprofile nx 12 lx -0.1 ux 1.1 ny 2 ly 0 uy 1 title 'example of fadeprofile command' png out.png |