我想在直方图上做一个平滑的线条。到目前为止,我已经尝试了所有平滑功能,但我无法得到结果。
对于我正在使用的直方图:
plot "file.scatter" u (hist($2,width)):(1.0) smooth freq w boxes notitle
但是当我要求gnuplot在这些上绘制一条平滑线时:
plot "file.scatter" u (hist($2,width)):(1.0) smooth freq w l notitle
我希望线图看起来像概率密度函数一样平滑(当然值必须标准化)。
任何线索专家?
答案 0 :(得分:2)
您需要进行卷积,如果您有最新版本的gnuplot(> = 5.1),则可以使用kdensity
plot $DATA smooth kdensity [bandwidth n] with boxes
请记住,最新版本的gnuplot也可以使用bins
功能对直方图进行分级。