Implementation of histogram printout.