Following the answers to this question: Histogram using gnuplot? and some other sources I created this script:
set terminal postscript eps enhanced color
set title "Histogram\_CreatesFile"
colour1="#00A0ff"
colour2="navy"
colour3="#ffA000"
colour4="#800000"
set output 'Histogram_CreatesFile.eps'
set yrange [0:]
set style fill solid 0.8 border -1
bin_width = 0.2
set boxwidth bin_width
bin_number(x) = floor(x/bin_width)
rounded(x) = bin_width * ( bin_number(x) + 0.5 )
plot 'Histogram_CreatesFile.txt' using (rounded($1)):(1) smooth frequency with boxes lc rgb colour1 notitle
and I have a test data file:
0
0.2
0.4
0.41
and everything is beautiful, but I get a weird empty space on the left of the first bar:
how can I make the graph start from the first bar, when I don't know apriori what are the values in the data file (i.e. it might start from other value than 0)?