ヒストグラムをプロットする次のスクリプトがあります。
set terminal postscript eps enhanced color
set title "Histogram\_CreatesFile"
colour1="#00A0ff"
colour2="navy"
colour3="#ffA000"
colour4="#800000"
set output 'Histogram_CreatesFile.eps'
set yrange [0:]
set style fill solid 0.8 border -1
bin_width = 0.2
set boxwidth bin_width
bin_number(x) = floor(x/bin_width)
rounded(x) = bin_width * ( bin_number(x) + 0.5 )
plot 'Histogram_CreatesFile.txt' using (rounded($1)):(1) smooth frequency with boxes lc rgb colour1 notitle
これは、いくつかの分布の経験的な実現であると想定されているため、より明確にするために、次のことを行います。
- バーを適切に正規化して、密度関数と比較できるようにします (バーの面積の合計は 1 になるはずだと思いますか?それは、各バーの高さを barWidth*numberOfElements で割る必要があることを意味します)。
- 同じ図上に、閉じた形式の式 (ガウスなど) で与えられる理論上の分布関数をプロットします。
どうすればこれを達成できますか?