import ROOT ROOT.gROOT.SetStyle("Plain") r1 = ROOT.TRandom() r2 = ROOT.TRandom3() r1.SetSeed(123456); r2.SetSeed(123456); entries = [1000, 100000, 1000000] for e in entries: h1 = ROOT.TH1D("h1_" + str(e), "TRandom, " + str(e) + " entries", 100, 0, 1); h2 = ROOT.TH1D("h2_" + str(e), "TRandom3, " + str(e) + " entries", 100, 0, 1); for i in range(1, e): h1.Fill(r1.Uniform()) h2.Fill(r2.Uniform()) c = ROOT.TCanvas() h1.SetMinimum(0.0) h1.Draw() c.SaveAs("01-rndTRandom2-" + str(e) + ".pdf") h2.SetMinimum(0.0) h2.Draw() c.SaveAs("01-rndTRandom3-" + str(e) + ".pdf")