'Method for non-equal bins histogram? Kernel-based maybe?

I have the following setup: a list of integers, where some of them repeat more than others.

I want to split them into bins, using a histogram, but such that, areas (on the Naturals) in which I have a lot of examples, will have smaller bins (and on the limit a bar per integer), while in areas which I have only a little information, the bar will include more integers, just like h in kernel estimations.

Any known method for such an example?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source