How to draw a histogram from a set of data