{ TH2D *frame = new TH2D("frame","",10,0.,10.,10,0.,1.); frame->SetStats(false); frame->Draw(); for (int n=0; n<=4; n++) { TH1D *P = new TH1D(Form("P%d",n),"",500,0.,10.); for (int i=1; i<=P->GetNbinsX(); i++) { double mu = P->GetBinCenter(i); P->SetBinContent(i,TMath::Poisson(n,mu)); } P->SetLineWidth(3); P->SetLineColor(kRed+n); P->Draw("csame"); } }