如果我的.dat文件已经具有正确的装箱数据,我知道如何在gnuplot中创建直方图(只需使用“with box”)。有没有办法获取数字列表并让gnuplot根据用户提供的范围和容器大小提供直方图?
最佳答案
是的,它的快速和简单虽然非常隐蔽:
binwidth=5
bin(x,width)=width*floor(x/width)
plot 'datafile' using (bin($1,binwidth)):(1.0) smooth freq with boxes
查看
help smooth freq
以查看为什么上面的方法会产生直方图要处理范围,只需设置xrange变量。
关于gnuplot - 使用gnuplot的直方图?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2471884/