This thread is a duplicate of this one: Convert canvas to histogram in the same plot Please use the other one.