How can I make a histogram with track of distribution?

As FJCC said, you code is still hard to read, please take a look into this FAQ about code formatting.