Sunday, 18 August 2013

gnuplot: misinterpreting data (histogram)

gnuplot: misinterpreting data (histogram)

I have following sample data file, which I want to plot in gnuplot as a
histogram
1 1
2 2
4 3
I am using following command to plot the data: plot "sample.data" with
boxes, which produces following chart:
##
##
######
######
########
########
whereas, the chart should look like this (there should be no value for 3):
##
##
## ##
## ##
#### ##
#### ##
From help boxwidth I understand that: "By default, adjacent boxes are
extended in width until they touch each other". This seems like a serious
bug/misfeature to me. I want my data to be represented correctly, and not
to plot nonexistent data. How can I trust gnuplot to represent my data
correctly, when this simple example fails?

No comments:

Post a Comment