【发布时间】:2018-11-06 06:55:57
【问题描述】:
如何在 gnuplot 的直方图中设置更少的 bin?
这是此直方图的http://leteckaposta.cz/514785176 数据。
谢谢
clear
reset
f(x)=a*exp((-(x-b)**2)/(2*c**2))
a=27.3634;
b=131.12;
c=11.0518;
set key off
set border 3
set yzeroaxis
set boxwidth 0.3 absolute
set style fill solid 1.0 noborder
bin_width = 0.1;
bin_number(x) = floor(x/bin_width)
rounded(x) = bin_width * ( bin_number(x) + 0.5 )
set ytics nomirror font "Times New Roman,12"
set xtics nomirror font "Times New Roman,12"
set key top right font "Times New Roman,12"
set xlabel "Počet detekcí" font "Times New Roman,12"
set ylabel "Četnost" font "Times New Roman,12"
plot [95:175] 'poisson.txt' using (rounded($1)):(1) smooth frequency with boxes title "Naměřeno", f(x) title "Gaussova křivka"
【问题讨论】:
-
您使用什么编程语言?添加适当的语言标签
-
对不起,我用的是gnuplot。