void hist027_THStack_palette_color() { auto hs = new THStack("hs", "Stacked 1D histograms colored using kOcean palette"); gStyle->SetPalette(kOcean); // Create three 1-d histograms and add them in the stack auto h1st = new TH1F("h1st", "test hstack", 100, -4, 4); h1st->FillRandom("gaus", 20000); hs->Add(h1st); auto h2st = new TH1F("h2st", "test hstack", 100, -4, 4); h2st->FillRandom("gaus", 15000); hs->Add(h2st); auto h3st = new TH1F("h3st", "test hstack", 100, -4, 4); h3st->FillRandom("gaus", 10000); hs->Add(h3st); // draw the stack hs->Draw("pfc nostack"); }