I have a data file from which I am creating a histogram.
Data file:
-0.1 0 0 JANE
1 1 1 BILL
2 2 1 BILL
1 3 1 BILL
6 4 0 JANE
35 5 0 JANE
9 6 1 BILL
4 7 1 BILL
24 8 1 BILL
28 9 1 BILL
9 10 0 JANE
16 11 1 BILL
4 12 0 JANE
45 13 1 BILL
My gnuplot script:
file='test.txt'
binwidth=10
bin(x,width)=width*floor(x/width)
set boxwidth 1
plot file using (bin($1,binwidth)):(1.0) smooth freq with boxes, \
file using (1+(bin($2,binwidth))):(1.0) smooth freq with boxes
I would like to plot this data in a log scale in y. However, there are some 0 values ββ(because some of the boxes are empty) that cannot be processed set logscale y. I get an error message Warning: empty y range [1:1], adjusting to [0.99:1.01].
According to gnuplot help: "The frequency option makes the data monotonous at x, points with the same value of x are replaced by one point with the summed values ββof y."
How can I take log10 () of the summed y values ββcomputed with smooth freq with boxes?
source
share