add auto margin to histogram