{ auto hs = new THStack("hs",""); auto h1 = new TH1F("h1","test hstack",10,-4,4); h1->FillRandom("gaus",20000); h1->SetFillColor(kRed); hs->Add(h1); auto h2 = new TH1F("h2","test hstack",10,-4,4); h2->FillRandom("gaus",15000); h2->SetFillColor(kBlue); hs->Add(h2); auto h3 = new TH1F("h3","test hstack",10,-4,4); h3->FillRandom("gaus",10000); h3->SetFillColor(kGreen); hs->Add(h3); auto cs = new TCanvas("cs","cs",10,10,700,900); TText T; T.SetTextFont(42); T.SetTextAlign(21); cs->Divide(2,2); cs->cd(1); hs->Draw(); T.DrawTextNDC(.5,.95,"Default drawing option"); cs->cd(2); hs->Draw("nostack"); T.DrawTextNDC(.5,.95,"Option \"nostack\""); cs->cd(3); hs->Draw("nostackb"); T.DrawTextNDC(.5,.95,"Option \"nostackb\""); cs->cd(4); hs->Draw("lego1"); T.DrawTextNDC(.5,.95,"Option \"lego1\""); }