in reply to Re^2: build a distribution
in thread build a distribution

It looks like you want a histogram generator. There are several available here at the Monastery. A Super Search, where title contains "histogram", yields (click on the link, then hit 'Search'):

?node_id=3989;HIT=histogram;re=N

Perhaps you could adapt the code from one of the following: