binning

Histogram using gnuplot?

為{幸葍}努か 提交于 2019-11-26 01:03:58
问题 I know how to create a histogram (just use \"with boxes\") in gnuplot if my .dat file already has properly binned data. Is there a way to take a list of numbers and have gnuplot provide a histogram based on ranges and bin sizes the user provides? 回答1: yes, and its quick and simple though very hidden: binwidth=5 bin(x,width)=width*floor(x/width) plot 'datafile' using (bin($1,binwidth)):(1.0) smooth freq with boxes check out help smooth freq to see why the above makes a histogram to deal with