我已经为.dat文件中的一些数据创建了直方图
binwidth=...
bin(x,width)=width*floor(x/width)
plot 'file' using (bin($1,binwidth) + binwidth/2):(1.0) smooth freq with boxes
Run Code Online (Sandbox Code Playgroud)
但是因为我的文件有超过1,000,000个条目,它从中读取并放入不同的箱中,我不知道每个箱的确切频率/密度.我想知道频率或者它可能将频率写入文件,是否有人知道它是否可能?我还想知道是否可以在y轴上绘制百分比,而不是频率,例如,如果我的频率是50,000,我的总数是1,000,000然后在y轴上有百分比而不是实际频率?
谢谢
您可以使用该stats命令获取条目数.
stats 'file'
binwidth=...
bin(x,width)=width*floor(x/width)
plot 'file' using (bin($1,binwidth) + binwidth/2):(1.0/STATS_records) smooth freq with boxes
Run Code Online (Sandbox Code Playgroud)
绘制使用百分比
plot 'file' using (bin($1,binwidth) + binwidth/2):(100.0/STATS_records) smooth freq with boxes
Run Code Online (Sandbox Code Playgroud)