cleaning in histogram plotting