In the previous classic style when one made a THStack of histograms you could set the fill style for different histograms and there would be a white fill between the patterns such that they would not overlap. The new modern style has overlapping patterns and makes the first histogram in the stack inherit all the following histograms patterns and colors. This makes the pattern much less readable.
This is even worse when there are bins with counts only from the first histogram as show below. This I would claim is a mistake as it indicates to the reader that all three histogram somehow contribute to that bin.
I have attached a short demonstration from a modified version of hstack.C
This example is using random gaussian.
TCanvas *hstack1() {
THStack *hs = new THStack("hs","Stacked 1D histograms");
//create three 1-d histograms
TH1F *h1st = new TH1F("h1st","test hstack",100,-4,4);
h1st->FillRandom("gaus",20000);
h1st->SetFillColor(kRed);
h1st->SetFillStyle(3002);
hs->Add(h1st);
TH1F *h2st = new TH1F("h2st","test hstack",100,-4,4);
h2st->FillRandom("gaus",15000);
h2st->SetFillColor(kBlue);
h2st->SetFillStyle(3003);
hs->Add(h2st);
TH1F *h3st = new TH1F("h3st","test hstack",100,-4,4);
h3st->FillRandom("gaus",10000);
h3st->SetFillColor(kGreen);
h3st->SetFillStyle(3004);
hs->Add(h3st);
TCanvas *cst = new TCanvas("cst","stacked hists",10,10,700,700);
// in top left pad, draw the stack with defaults
cst->cd(1);
hs->Draw();
return cst;
}
This example shows three histograms with counts in only one bin for each histogram.
[code]TCanvas *hstack() {
THStack *hs = new THStack(“hs”,“Stacked 1D histograms”);
//create three 1-d histograms
TH1F *h1st = new TH1F(“h1st”,“test hstack”,3,0,3);
h1st->SetBinContent(1,10);
h1st->SetFillColor(kRed);
h1st->SetFillStyle(3002);
hs->Add(h1st);
TH1F *h2st = new TH1F(“h2st”,“test hstack”,3,0,3);
h2st->SetBinContent(2,5);
h2st->SetFillColor(kBlue);
h2st->SetFillStyle(3003);
hs->Add(h2st);
TH1F *h3st = new TH1F(“h3st”,“test hstack”,3,0,3);
h3st->SetBinContent(3,2);
h3st->SetFillColor(kGreen);
h3st->SetFillStyle(3004);
hs->Add(h3st);
TCanvas *cst = new TCanvas(“cst”,“stacked hists”,10,10,700,700);
// in top left pad, draw the stack with defaults
cst->cd(1);
hs->Draw();
return cst;
}[/code]