kmsmith137 wrote:
> How can I make a histogram in gnuplot?
From the point of view of the purity, you shouldn't be trying to. The
Unix philosophy is "one tool <-> one task". gnuplot's task is plotting,
not data processing.
> I could write a standalone program which preprocesses my sample file, and
> outputs the bin ranges and counts, but surely there is some way to do the
> binning internally to gnuplot?
There's one, but it's a bit quirky:
bw = 5 # substitute what you want
bin(x,width)=width*floor(x/width)
plot 'data' using (bin($1,bw)):(1.0) smooth freq with boxes
See "help smooth" to understand what this does.
|