I figured it out!! its the data. just multiply the data by some decimal number say foreach $i (@data){ $i = $i *1000; } get the distinct values and proceed to the histogram. The bins seem to work for only integers.(I am still a novice , please correct me if i am wrong). So if anyone has decimal numbers and need to plot histogram. just scale it!!! Thanks a lot for the all help! This site is very helpful. I am learning a lot