按照这个问题的答案:Histogram using gnuplot? 以及我创建此脚本的其他一些来源:
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
我有一个测试数据文件:
0
0.2
0.4
0.41
一切都很漂亮,但我在第一个栏的左侧得到了一个奇怪的空白空间:
当我不知道先验数据文件中的值是什么时(即它可能从0以外的其他值开始),如何使图表从第一个条开始?