How to build density distribution