Use nbins, xmin and xmax variables; change scaled hists to pointers