Calculating correct margin for plotting histogram

Hi,

Maybe it is related to this topic?

Cheers, Bertrand.